2014-03-18 114 views
8

我試着對我已經提交但未推送的代碼執行rebase,因爲我聽說可能會影響我正在處理的內容的來源發生了一些變化。這裏是我得到的:Git rebase因衝突失敗,但沒有衝突

$ git rebase origin/thor-develop 
First, rewinding head to replay your work on top of it... 
Applying: PH-2127: F193: SYO for Signed in User 
Using index info to reconstruct a base tree... 
M  js/angular/localization/StoreListCtrl.js 
M  templates/default_site/site_embed.group/html_header.html 
<stdin>:17: trailing whitespace. 

<stdin>:73: trailing whitespace. 

<stdin>:77: trailing whitespace. 

<stdin>:78: trailing whitespace. 
          $scope.address_dropdown = addressStore.getTop($scope.my_occasion, 3); 
<stdin>:79: trailing whitespace. 

warning: squelched 16 whitespace errors 
warning: 21 lines add whitespace errors. 
Falling back to patching base and 3-way merge... 
Auto-merging templates/default_site/site_embed.group/html_header.html 
Auto-merging js/angular/localization/StoreListCtrl.js 
CONFLICT (content): Merge conflict in js/angular/localization/StoreListCtrl.js 
Failed to merge in the changes. 
Patch failed at 0001 PH-2127: F193: SYO for Signed in User 

When you have resolved this problem run "git rebase --continue". 
If you would prefer to skip this patch, instead run "git rebase --skip". 
To check out the original branch and stop rebasing run "git rebase --abort". 

我們使用Tortoise Git作爲前端編輯器,所以我進入了Resolve工具。它通常會顯示差異,當然這是不錯的,而衝突則不然。它顯示我在引用的文件(StoreListCtrl.js)中完全沒有衝突。顯然存在差異,但根本沒有衝突。這是什麼意思,我該如何解決這個問題,以便我可以完成rebase並最終合併我的代碼?

+0

小心一點。驗證你的工作變得有效,總是一個好主意。我通常的解決方案是在重新綁定之前將結果與分支頭部進行比較(除非您更改了補丁以解釋上游更改,並且希望這些補丁很簡單,以便您可以輕鬆驗證它們是否正確),否則應該沒有區別。目前我的環境似乎被竊聽,git正在擺脫類似於OP的git rebase。如果我「重新命名 - 繼續」,並且稍後再比較,我的autosquash修正會丟失。 – bambams

回答

7

解析工具可能會自動爲您解決衝突。這發生在我身上(並使我感到困惑)。在這種情況下,您可以直接前往git rebase --continue

完整的清單是:

  • 如果git status顯示任何未上演的變化:
    • 如果這些文件具有V形<<<>>>標記衝突:
      • 解決衝突和保存文件
    • 現在階段所有未上演的變化與git add:這標誌着衝突,解決
  • 現在解決任何衝突,並標明:使用git rebase --continue
+0

這似乎發生了。把我從太聰明的軟件中拯救出來。 – EmmyS

+0

TortoiseGit不會調用'git rebase --continue'。它有UI來解決衝突,你點擊Continue按鈕來運行'git commit'並選擇下一個提交。 – linquize

+0

我沒有說它已經繼續了rebase,但它已經解決了衝突。 – Useless