2010-10-04 103 views
7

我目前正在使用git-hub上的項目,但我們的開發團隊正在使用subversion。我一直在做以下,以保持git的樞紐同步與我們的SVN倉庫:git svn rebase與git中不存在的文件發生衝突失敗

git svn rebase 
git pull origin master 
git push origin master 

這一直工作正常,但不知何故,我已經弄亂的東西了,現在我有一個問題,一個文件時,我做的rebase:

Craig-Nakamotos-MacBook-Pro:cl4 cnakamoto$ git svn rebase 
First, rewinding head to replay your work on top of it... 
Applying: minor fix to table class 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
No changes -- Patch already applied. 
Applying: remove README, will re-add via svn 
Applying: trying to fix readme 
Applying: adding README file 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
Auto-merging README 
CONFLICT (add/add): Merge conflict in README 
Failed to merge in the changes. 
Patch failed at 0020 adding README file 

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

rebase refs/remotes/trunk: command returned error: 1 

我必須刪除並重新添加git和/或svn中的文件,現在我有這個問題。奇怪的是README文件沒有出現在我當前的git master中。我嘗試從我的svn主幹中刪除它,但這沒有什麼區別。我解決了衝突並重新添加了文件等無濟於事。我甚至刪除了我的本地git並重新開始。東西必須被損壞。

我也嘗試過的git變基--skip,但是這給了我:

Craig-Nakamotos-MacBook-Pro:cl4 cnakamoto$ git rebase --skip 
HEAD is now at c4da146 trying to fix readme 
Applying: remove README, will re-add via svn 
Using index info to reconstruct a base tree... 
Falling back to patching base and 3-way merge... 
CONFLICT (delete/modify): README deleted in remove README, will re-add via svn and modified in HEAD. Version HEAD of README left in tree. 
Failed to merge in the changes. 
Patch failed at 0021 remove README, will re-add via svn 

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

Craig-Nakamotos-MacBook-Pro:cl4 cnakamoto$ 

有誰知道我怎麼能解決這個問題?這讓我瘋狂。我根本不需要README文件,所以我不在乎是否必須吹掉它並重新創建它。謝謝!

回答

3

你試過git rebase --skip?維護一個單獨的git倉庫容易出問題。 git dcommit重寫您的本地git提交(即更改SHA-1校驗和)。所以,在你正常的工作流程:

  • 變化碼
  • 承諾GitHub的
  • 變化碼
  • 承諾GitHub的
  • 混帳SVN變基
  • 的git拉出身主
  • 混帳推原產主
  • git svn dcommit

git pull做了兩件事,一個git fetch後跟一個git merge。合併可能會造成麻煩。此外,在最後一個dcommit中,本地git提交已更改,並且不再與前一個命令中推送給github的內容匹配。

你可以在git-svn上閱讀here

+1

我確實嘗試了git rebase --skip,但那給了我更多的錯誤,我會將它們添加到我原來的問題中。 – 2010-10-04 15:11:09

+1

p.s.感謝您試圖幫助並澄清,我們基本上不會通過git進行更改,我只是從我們的顛覆回購更新git master,所有更改都是在svn中完成的,所以我希望它不應該是太麻煩了 – 2010-10-04 15:15:02