2012-03-13 103 views
8

我使用git svn與擁有svn存儲庫(我們的東西在github中)的客戶端一起工作。git svn rebase總是與我自己的提交衝突

所以我按照指示,做一個混帳SVN變基,然後混帳SVN dcommit

這工作的第一次,但從那時起基礎重建總是衝突幾乎每一個承諾。它似乎沒有意識到哪些提交是我的,並且抱怨事情是相互衝突的。每次我必須通過rebase - 跳過我的方式,直到它通過併成功應用我的最新提交。它永遠不會知道我最後一次進行重新設定的位置(我相信這是應該發生的事情)。

首先...爲什麼?那麼我能以某種方式解決這個問題嗎?

First, rewinding head to replay your work on top of it... 
Applying: Deleting their old build management stuff as its pretty crappy. Will re-build at some point. 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: Added some error checking around Android specific calls 
Using index info to reconstruct a base tree... 
<stdin>:16: space before tab in indent. 
      Android.hideKeyboard(); 
<stdin>:31: space before tab in indent. 
        Android.launchNewAccount(); 
warning: 2 lines add whitespace errors. 
Falling back to patching base and 3-way merge... 
CONFLICT (modify/delete): src/LoginForm.js deleted in HEAD and modified in Added some error checking around Android specific calls. Version Added some error checking around Android specific calls of src/LoginForm.js left in tree. 
Auto-merging src/ChildPanel.js 
CONFLICT (content): Merge conflict in src/ChildPanel.js 
Failed to merge in the changes. 
Patch failed at 0002 Added some error checking around Android specific calls 

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". 

回答

7

我不知道你是怎麼陷入這種情況的,但我可以告訴你如何讓自己出門。

首先,根據上游SVN創建一個新分支:git checkout -b mynewbranch refs/remotes/oldbranch(這裏使用git-svn ref ID)。請參考:git checkout mynewbranch

最後,從你的新分支這並沒有承諾SVN(類似git cherry-pick refs/remotes/oldbranch..oldbranch摘櫻桃的提交。

您遇到的問題最可能的原因是,你推後改寫歷史對SVN進行更改;當您使用git-svn進行提交時,它會將git-svn-id置於提交日誌中,該提交日誌會更改修訂哈希值。如果您隨後移動提交文件,則開始在SVN版本的備用Universe中工作與非SVN本地衝突。

+1

哈哈。愛你的開場白。我會給這個鏡頭謝謝! – 2012-03-13 23:03:19

+1

我假設由git-svn ref ID表示分支名稱'remotes/git-svn'? – 2012-03-13 23:06:30

+1

呃... git co不是命令。我假設git checkout? (只要確保我沒有在那個時候使用git svn) – 2012-03-13 23:07:17