解决冲突后,git仍然抱怨? [英] After fixing conflicts git still complains?
问题描述
通常情况下,当我拉入队友的变化时,通常会发生冲突:
...
CONFLICT(内容):在app / views / search / index.html.erb中合并冲突
自动合并public / stylesheets / application.css
CONFLICT(内容):在公共/ stylesheets / application.css中合并冲突
在更改中合并失败。
修补程序在0001组织
时失败当你解决这个问题时,运行git rebase --continue。
如果您希望跳过此修补程序,请运行git rebase --skip。
要恢复原始分支并停止重新分配运行git rebase --abort。
所以在打开每个冲突文件后,修改它然后提交固定文件:
〜/ Projects / myApp [956f6e1 ...]%git rebase --continue
您必须编辑所有合并冲突,然后
将它们标记为已解决使用git add
我仍然得到相同的错误... p>
〜/ Projects / myApp [64b3779 ...]%git rebase --continue
应用:整理
没有变化 - 你忘了使用'git add'?
当你解决这个问题时,运行git rebase --continue。
如果您希望跳过此修补程序,请运行git rebase --skip。
要恢复原始分支并停止重新分配运行git rebase --abort。
我总是会遇到这个问题,但我从来没有真正选择解决它,我总是会懒得和 git rebase --skip
。
我如何真正以正确的方式解决冲突?
因此,打开每个文件后发生冲突,修复它然后提交固定文件...
问题是你不应该 commit
修正。如果 a.txt
存在合并冲突,那么您的shell日志应该如下所示:
$ vim a.txt#修复冲突
$ git添加a.txt
$#添加和重建之间没有提交!
$ git rebase --continue
调用 git rebase -
我不知道如何在提交之前回头,当你在提交之前,继续重新在一个rebase的中间。 git reset --hard HEAD
可能会诀窍,但是我个人觉得更安全,直接转到 git rebase --abort
并重新开始,而不必在中间提交。
I usually rebase
when I pull in changes from my teammates, and often time I have conflicts:
...
CONFLICT (content): Merge conflict in app/views/search/index.html.erb
Auto-merging public/stylesheets/application.css
CONFLICT (content): Merge conflict in public/stylesheets/application.css
Failed to merge in the changes.
Patch failed at 0001 organizing
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".
So after opening each file with a conflict, fixing it then committing the fixed files:
~/Projects/myApp[956f6e1...]% git rebase --continue
You must edit all merge conflicts and then
mark them as resolved using git add
I still get the same error...
~/Projects/myApp[64b3779...]% git rebase --continue
Applying: organizing
No changes - did you forget to use 'git add'?
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".
I've sort-of always had this problem, but I guess never really chose to address it, I would I always just get lazy and git rebase --skip
.
How do I actually resolve the conflict the right way?
So after opening each file with a conflict, fixing it then committing the fixed files...
The problem is that you aren't supposed to commit
the fixes. If a.txt
has a merge conflict, then your shell log should look like:
$ vim a.txt # fix conflict
$ git add a.txt
$ # no commit between add and rebase!
$ git rebase --continue
Calling git rebase --continue
will take care of the commit itself.
I'm not sure how to "get back" to before your commit, when you're in the middle of a rebase. git reset --hard HEAD
would probably do the trick, but personally I'd feel safer just going straight to git rebase --abort
and starting over without committing in the middle.
这篇关于解决冲突后,git仍然抱怨?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!