How to resolve a conflict with git-svn?

扶醉桌前 提交于 2019-12-03 01:34:23

问题


What is the best way to resolve a conflict when doing a git svn rebase, and the git branch you are on becomes "(no-branch)"?


回答1:


You can use git mergetool to view and edit the conflicts in the usual fashion. Once you are sure the conflicts are resolved do git rebase --continue to continue the rebase, or if you don't want to include that revision do git rebase --skip




回答2:


While doing a git svn rebase, if you have merge conflicts here are some things to remember:

1) If anything bad happens while performing a rebase you will end up on a (no-branch) branch.

2) If you run git status, you'll see a .dotest file in your working directory. This is safe to ignore.

3) If you want to abort the rebase use the following command.1

git rebase --abort

4) If you have a merge conflict:

  1. Manually edit the files to resolve the conflicts
  2. Stage any changes with git add [file]
  3. Continue the rebase with git rebase --continue2
    • If git asks: "did you forget to call git add?", then the edits turned the conflict into a no-op change3. Continue with git rebase --skip

You may have to repeat this process until the rebase is complete. At any point you can git rebase --abort to cancel and abandon the rebase.


1: There is no --abort option for git svn rebase.

2: There is no --continue option for git svn rebase.

3: This is very strange, but the files are in a state where git thinks they are the same after that particular patch. The solution is to "skip" that patch on the rebase.



来源:https://stackoverflow.com/questions/112839/how-to-resolve-a-conflict-with-git-svn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!