2010-10-04 110 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