今天我有一种奇怪的变形体验。我不明白出了什么问题。你能否回顾一下,看看我是否犯过任何明显的错误。最终的结果似乎没问题,但我只是不明白我应该如何做到这一点。
我想要由同事提出一些更改,但我还没有提交更改。所以我首先提交我的更改:
$ git commit -a -m "variablekey::assignMissing zapspace after semi-colon separation"
[master d8b462f] variablekey::assignMissing zapspace after semi-colon separation
3 files changed, 11 insertions(+), 3 deletions(-)
我用pull with rebase。我想提取所有更新,然后在我们之上应用我的提交。
$ git pull --rebase
X11 forwarding request failed on channel 0
First, rewinding head to replay your work on top of it...
Applying: variablekey::assignMissing zapspace after semi-colon separation
Using index info to reconstruct a base tree...
M package/kutils/R/variableKey.R
Falling back to patching base and 3-way merge...
Auto-merging package/kutils/R/variableKey.R
CONFLICT (content): Merge conflict in package/kutils/R/variableKey.R
error: Failed to merge in the changes.
Patch failed at 0001 variablekey::assignMissing zapspace after semi-colon separation
The copy of the patch that failed is found in: .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".
这是预料之中的。我编辑了文件" variableKey.R"。我找到了<< ==>>的部分围绕它并纠正代码。编辑完文件后,我运行
$ git add .
$ git commit -m "Edited variableKey to resolve conflicts"
[detached HEAD dbc8e16] Resolved merge conflict
5 files changed, 500 insertions(+), 4 deletions(-)
create mode 100644 package/kutils/R/cfaTable.R-pj
create mode 100644 package/kutils/R/import-1.R
$ git rebase --continue
Applying: variablekey::assignMissing zapspace after semi-colon separation
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 add,但我做到了。
$ git status .
rebase in progress; onto 2a68a60
You are currently rebasing branch 'master' on '2a68a60'.
(all conflicts fixed: run "git rebase --continue")
nothing to commit, working tree clean
这里的手册:https://help.github.com/articles/resolving-merge-conflicts-after-a-git-rebase警告说,"您可以运行git rebase --skip来完全跳过提交。这意味着将不包括由有问题的提交引入的任何更改。您很少选择此选项。"
我最终运行" git rebase --skip"无论如何。
我发现这些我每年只使用两三次的git功能很棘手,我忘记了细微差别。
答案 0 :(得分:4)
将已解决冲突的文件添加到索引后,正常的继续方法是直接git rebase --continue
。
首先创建一个新的提交,你从rebase中“拿走”了提交,这样当它试图应用它时,就没有什么可做的了。