我正在运行一个rebase操作,出现了冲突:
没问题-我做了一个小改动,我知道会引起冲突:
$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: Better `SelectMotifsView.js`
Using index info to reconstruct a base tree...
M browser/AddLinkView.js
M browser/SelectMotifsView.js
M browser/index.html
Falling back to patching base and 3-way merge...
Auto-merging browser/index.html
CONFLICT (content): Merge conflict in browser/index.html
Failed to merge in the changes.
Patch failed at 0001 Better `SelectMotifsView.js`
The copy of the patch that failed is found in:
/Users/dmitry/dev/links/.git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
没问题-我做了一个小改动,我知道会引起冲突:
diff --cc browser/index.html
index ba9c4f3,4c2a1c2..0000000
--- a/browser/index.html
+++ b/browser/index.html
@@@ -40,6 -40,7 +40,10 @@@
<label>
<%= label %>
<select class="form-control" name="motif">
++<<<<<<< HEAD
++=======
+ <% console.log(exclude); %>
++>>>>>>> Better `SelectMotifsView.js`
<% motifs.each(function(motif) { if (!exclude || exclude.indexOf(motif) < 0) { %>
<option value="<%= motif.get('id') %>"><%= motif.get('name') %></option>
<% } }); %>
我想保留空的HEAD
版本,因此我只需删除整个内容:
++<<<<<<< HEAD
++=======
+ <% console.log(exclude); %>
++>>>>>>> Better `SelectMotifsView.js`
我保存文件,browser/index.html
,然后执行 git add browser/index.html
命令:
$ git add browser/index.html
$ git rebase --continue
但是:
Applying: Better `SelectMotifsView.js`
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
我从未见过这种情况... git status
显示没有剩余的未解决路径。该怎么办?我在其他相关问题上读到,这可能是使用--skip
的好方法,但这似乎不是一个空提交。或者我错了吗?
M
状态文件。如果只有一个冲突,并选择保持文件不变,则应该有另外两个更改的文件。但也许那些文件最终被自动解决为“无更改”了吗?(从上面看不太清楚。) - torekgit add
。没有其他未解决的路径。 - Dmitry Minkovskygit rebase
对实际修改了内容的提交报告此类消息,所以建议尝试使用--skip
。 - Fred Foo--allow-empty
手动提交,或尝试使用--keep-empty
,尽管源代码建议后者在此时不起作用。) - torek