2012-10-06 39 views
5

這是我所嘗試過的。希望有人有時間看看這個,並提出一些建議。謝謝!不能繼續git rebase

編輯:我相信我已經回答了我的問題:https://stackoverflow.com/a/12760672/906794

  • 克隆我的回購

    $ git clone leoj3n/roots 
    Cloning into 'roots'... 
    remote: Counting objects: 3177, done. 
    remote: Compressing objects: 100% (1362/1362), done. 
    remote: Total 3177 (delta 2117), reused 2761 (delta 1792) 
    Receiving objects: 100% (3177/3177), 1.40 MiB | 609 KiB/s, done. 
    Resolving deltas: 100% (2117/2117), done. 
    Checking out files: 100% (146/146), done. 
    
  • 更改目錄

    $ cd roots 
    
  • 檢查狀態

    roots(parent) $ git status 
    # On branch parent 
    nothing to commit (working directory clean) 
    
  • 添加上游

    roots(parent) $ git remote add upstream retlehs 
    roots(parent) $ git remote 
    origin 
    upstream 
    
  • roots(parent) $ git fetch --all 
    Fetching origin 
    Fetching upstream 
    remote: Counting objects: 70, done. 
    remote: Compressing objects: 100% (30/30), done. 
    remote: Total 56 (delta 28), reused 51 (delta 23) 
    Unpacking objects: 100% (56/56), done. 
    From git://github.com/retlehs/roots 
    * [new branch]  classic -> upstream/classic 
    * [new branch]  grunt  -> upstream/grunt 
    * [new branch]  improve_sidebar_config -> upstream/improve_sidebar_config 
    * [new branch]  master  -> upstream/master 
    * [new branch]  vcard_refactor -> upstream/vcard_refactor 
    * [new tag]   5.1.0  -> 5.1.0 
    * [new tag]   5.2.0  -> 5.2.0 
    * [new tag]   6.0.0  -> 6.0.0 
    * [new tag]   6.1.0  -> 6.1.0 
    
  • 再次基於parentupstream/master

    roots(parent) $ git rebase -i upstream/master 
    
    <<<<<< BEGIN WHAT I HAD IN vi >>>>>> 
    pick 4904103 improved url cleaning for child themes 
    s 986e6de added some is_child_theme() checks 
    s 2860aee urls now look like /child/css/* 
    s 4282ee0 Look for files in child, then in roots 
    p bf9a89a Now using Theme Hook Alliance 
    f 56d1211 Added THA utility script 
    f 7702269 Added missing hooks 
    f 14204d8 Support for multisite 
    f aca4577 No more multisite rewrites 
    f 8144b83 Revert some changes 
    pick fbf1dec Added filter to disable sidebars 
    pick 9b77e72 Added font-awesome 
    f 161864d Remove test code 
    <<<<<< END WHAT I HAD IN vi >>>>>> 
    

    然後我得到這個錯誤:

    error: could not apply 4904103... improved url cleaning for child themes 
    
    When you have resolved this problem, run "git rebase --continue". 
    If you prefer to skip this patch, run "git rebase --skip" instead. 
    To check out the original branch and stop rebasing, run "git rebase --abort". 
    Could not apply 4904103... improved url cleaning for child themes 
    
  • 解決衝突

    roots(parent|REBASE-i) $ git mergetool 
    merge tool candidates: opendiff kdiff3 tkdiff xxdiff meld tortoisemerge gvimdiff diffuse ecmerge p4merge araxis bc3 emerge vimdiff 
    Merging: 
    lib/config.php 
    
    Normal merge conflict for 'lib/config.php': 
        {local}: modified file 
        {remote}: modified file 
    Hit return to start merge resolution tool (opendiff): 
    2012-10-06 05:10:11.363 FileMerge[22088:707] Unable to load platform at path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform 
    2012-10-06 05:10:11.364 FileMerge[22088:707] Unable to load platform at path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform 
    

    注意我得到運行了opendiff一些錯誤。

  • 完成解決衝突,所以繼續

    roots(parent|REBASE-i) $ git rebase --continue 
    You must edit all merge conflicts and then 
    mark them as resolved using git add 
    
  • 咦?檢查狀態:

    roots(parent|REBASE-i) $ git status 
    # Not currently on any branch. 
    # You are currently rebasing. 
    # (all conflicts fixed: run "git rebase --continue") 
    # 
    # Changes to be committed: 
    # (use "git reset HEAD <file>..." to unstage) 
    # 
    # modified: lib/config.php 
    # modified: lib/htaccess.php 
    # 
    # Untracked files: 
    # (use "git add <file>..." to include in what will be committed) 
    # 
    # lib/config.php.orig 
    
  • 刪除合併備份文件

    roots(parent|REBASE-i) $ rm lib/config.php.orig 
    
    roots(parent|REBASE-i) $ git status 
    # Not currently on any branch. 
    # You are currently rebasing. 
    # (all conflicts fixed: run "git rebase --continue") 
    # 
    # Changes to be committed: 
    # (use "git reset HEAD <file>..." to unstage) 
    # 
    # modified: lib/config.php 
    # modified: lib/htaccess.php 
    # 
    
  • 繼續變基

    roots(parent|REBASE-i) $ git rebase --continue 
    You must edit all merge conflicts and then 
    mark them as resolved using git add 
    
  • 嗯,嘗試添加一切

    roots(parent|REBASE-i) $ git add -A 
    
    roots(parent|REBASE-i) $ git rebase --continue 
    You must edit all merge conflicts and then 
    mark them as resolved using git add 
    

這是當我放棄,並使這個S.O.題。


這裏有更多的一些信息:

roots(parent|REBASE-i) $ git diff-files --ignore-submodules 
:100644 100644 f65cf1dc4573c51e54d7cf3772d06caf96726616 0000000000000000000000000000000000000000 assets/js/vendor/jquery-1.8.2.min.js 

我認爲這可能與合併工具上面做了opendiff通知書的錯誤。

roots(parent|REBASE-i) $ git config --list 
user.name=xxxxxx 
user.email=xxxxxx 
credential.helper=osxkeychain 
alias.pu=!git fetch origin -v; git fetch upstream -v; git merge upstream/master 
alias.co=checkout 
alias.ci=commit 
alias.rb=rebase 
color.ui=auto 
core.excludesfile=/Users/xxxxxx/.gitignore_global 
core.repositoryformatversion=0 
core.filemode=true 
core.bare=false 
core.logallrefupdates=true 
core.ignorecase=true 
core.precomposeunicode=false 
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* 
[email protected]:leoj3n/roots.git 
branch.parent.remote=origin 
branch.parent.merge=refs/heads/parent 
remote.upstream.url=git://github.com/retlehs/roots.git 
remote.upstream.fetch=+refs/heads/*:refs/remotes/upstream/* 

出人意料的是,我能變基使用TortoiseMerge我的Windows機器上。

+1

從您獲得狀態消息被發現,我認爲你必須運行至少混帳1.7.12,在這種情況下,「你必須編輯所有的合併衝突,然後[..]」錯誤輸出當'git diff-files --quiet --ignore-submodules'用非零退出代碼退出時。你可以運行'git diff-files --ignore-submodules'並將輸出粘貼到你的問題中嗎? –

+0

請參閱最後的編輯。 – leoj3n

+0

很奇怪 - 我不確定爲什麼'assets/js/vendor/jquery-1.8.2.min.js'出現在'git diff-files'輸出中,而不是'git status'。該文件目前在工作樹中? –

回答

3

看來問題是因爲文件時間關閉。該回購協議在網絡驅動器和訪問/由Windows和Mac電腦修改...

所有我需要做的,現在看來,是改變單一的配置項...

git config --global core.trustctime false 

的解決方案在https://stackoverflow.com/a/5255700/906794

+2

誰能想到。很高興你找到你的答案 – Ikke

+0

另請參閱http://www.git-tower.com/blog/make-git-rebase-safe-on-osx – leoj3n