git svn rebase与git中不存在的文件冲突失败 [英] git svn rebase is failing with a conflict to a file that does not exist in git

查看:406
本文介绍了git svn rebase与git中不存在的文件冲突失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  git svn rebase 
git pull原产大师
git push原产大师

这工作正常,但不知何故,有些东西和现在我有一个文件时,我做了rebase的问题:

  Craig-Nakamotos-MacBook-Pro:cl4 cnakamoto $ git svn rebase 
首先,倒带头重播你的作品...
应用:对表类的小修改
使用索引信息重建基础树...
回退到补丁库和3路合并...
没有变化 - 补丁已经被应用。
应用:添加README文件
应用:添加README文件
使用索引信息重建基础树...
回退到修补基础和3路合并...
没有变化 - 已经应用补丁。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:添加README文件
使用索引信息重新构建基本树...
回退到修补基地和3路合并...
没有更改 - 修补程序已经应用。
应用:删除README,将通过svn
重新添加应用:尝试修复自述文件
应用:添加自述文件
使用索引信息重建基本树...
回退到补丁库和3路合并...
自动合并README
CONFLICT(添加/添加):在README中合并冲突
在变更中合并失败。
修补失败,在0020加入自述文件

当你解决这个问题时,运行git rebase --continue。
如果您希望跳过此修补程序,请运行git rebase --skip。
要恢复原始分支并停止重新分配运行git rebase --abort。

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

I必须删除并重新添加git和/或svn中的文件,现在我有这个问题。奇怪的是README文件没有出现在我当前的git master中。我尝试从我的svn主干中删除它,但这没有什么区别。我解决了冲突并重新添加了文件等无济于事。我甚至删除了我的本地git并重新开始。东西必须被损坏。



我也尝试了git rebase --skip,但是这给了我:

  Craig-Nakamotos-MacBook-Pro:cl4 cnakamoto $ git rebase --skip 
HEAD现在在c4da146试图修复readme
应用:删除README,将通过svn $ b $重新添加b使用索引信息重新构建基础树...
回退到修补基础和3路合并...
CONFLICT(删除/修改):在删除README中删除自述文件,将重新添加通过svn并在HEAD中修改。 README的HEAD版本留在树中。
未能在更改中合并。
补丁在0021失败删除README,将通过svn

重新添加当你解决这个问题时,运行git rebase --continue。
如果您希望跳过此修补程序,请运行git rebase --skip。
要恢复原始分支并停止重新分配运行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 origin master

  • git push origin master

  • git svn dcommit



git pull 完成两件事,一个 git fetch ,后面跟着一个 git merge 。合并可能会造成麻烦。此外,在最后一个dcommit中,本地git提交已更改,不再与前一命令中推送到github的内容匹配。



您可以阅读git-svn 此处


I am currently working on a project on git-hub but our development team is using subversion. I have been doing the following to keep git-hub synced with our svn repository:

git svn rebase
git pull origin master
git push origin master

This has been working fine, but somehow I have messed something up and now I have a problem with one file when I do the 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

I must have deleted and re-added the file in git and/or svn and now I have this problem. The strange thing is that the README file does not appear in my current git master. I tried deleting it from my svn trunk but this makes no difference. I have resolved the conflict and re-added the file, etc. to no avail. I even deleted my local git and started over. Something must be corrupted.

I also tried git rebase --skip, but that gives me:

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$ 

Does anyone know how I can fix this? It is driving me crazy. I don't need the README file at all, so I don't care if I just have to blow it away and recreate it. Thanks!

解决方案

Did you try git rebase --skip? Maintaining a separate git repo is going to be trouble prone. git dcommit rewrites your local git commits (i.e., changes the SHA-1 checksums). So, in your normal workflow:

  • change code
  • commit to github
  • change code
  • commit to github
  • git svn rebase
  • git pull origin master
  • git push origin master
  • git svn dcommit

The git pull does two things, a git fetch followed by a git merge. The merge can be trouble. Also, in that last dcommit, the local git commits were changed and no longer match what was pushed to github in the previous command.

You can read up on git-svn here.

这篇关于git svn rebase与git中不存在的文件冲突失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆