git svn rebase与git中不存在的文件冲突失败

我目前正在开发一个关于git-hub的项目,但我们的开发团队正在使用subversion。 我一直在做以下操作来保持git-hub与我们的svn仓库同步:

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 rebase --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文件,所以我不在乎是否必须吹掉它并重新创建它。 谢谢!


你有没有尝试git rebase --skip ? 维护一个单独的git仓库容易出问题。 git dcommit重写您的本地git提交(即更改SHA-1校验和)。 所以,在你的正常工作流程中:

  • 更改代码
  • 承诺github
  • 更改代码
  • 承诺github
  • git svn rebase
  • git pull起源大师
  • git push origin master
  • git svn dcommit
  • git pull执行两件事,一个是git fetch然后是一个git merge 。 合并可能会造成麻烦。 此外,在最后一个dcommit中,本地git提交已更改,并且不再与前一个命令中推送给github的内容匹配。

    你可以在这里阅读git-svn。

    链接地址: http://www.djcxy.com/p/3013.html

    上一篇: git svn rebase is failing with a conflict to a file that does not exist in git

    下一篇: How to copy docker images from one host to another without via repository?