如何在重新定位时解决合并冲突?

时间:2016-12-28 13:00:53

标签: git git-rebase git-merge-conflict

interactive rebase in progress; onto 2e0a7b5
Last commands done (6 commands done):
   f 6d90337 show_user POD reworked
   f 3bafc68 Minor Updates in User.pm POD
  (see more in file .git/rebase-merge/done)
Next command to do (1 remaining command):
   f 6c3632d Moved /wiki/ into /lib/wiki/
  (use "git rebase --edit-todo" to view and edit)
You are currently rebasing branch 'wiki' on '2e0a7b5'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add/rm <file>..." as appropriate to mark resolution)

1   added by them:   ../lib/wiki/user_registration.pod
2   added by us:     Registration.pod
3   both deleted:    user_registration.pod

no changes added to commit (use "git add" and/or "git commit -a")

我使用下一个命令来解决冲突:

git add Registration.pod
git add user_registration.pod
git rm ../lib/wiki/user_registration.pod
在此之后

git status

interactive rebase in progress; onto 2e0a7b5
Last commands done (6 commands done):
   f 6d90337 show_user POD reworked
   f 3bafc68 Minor Updates in User.pm POD
  (see more in file .git/rebase-merge/done)
Next command to do (1 remaining command):
   f 6c3632d Moved /wiki/ into /lib/wiki/
  (use "git rebase --edit-todo" to view and edit)
You are currently rebasing branch 'wiki' on '2e0a7b5'.
  (all conflicts fixed: run "git rebase --continue")

nothing to commit, working directory clean

但我无法继续重新定位git rebase --continue

error: could not apply 6c3632d... Moved /wiki/ into /lib/wiki/

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".

fatal: Unable to create '/home/kes/work/projects/artcoin.io/artcoin/.git/MERGE_RR.lock': File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

Could not apply 6c3632d9d00bdc97ba3879cd3a10a2517891b284... Moved /wiki/ into /lib/wiki/
fatal: Unable to create '/home/kes/work/projects/artcoin.io/artcoin/.git/MERGE_RR.lock': File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

如何解决此类冲突并继续变基?

1 个答案:

答案 0 :(得分:1)

我通过在完成之后显式地执行最后一个命令来解决它:

git mv ../wiki/Registration.pod wiki/Registration.pod

所有命令:

git add Registration.pod
git add user_registration.pod
git rm ../lib/wiki/user_registration.pod
git mv ../wiki/Registration.pod wiki/Registration.pod

删除此文件后(由于SegFault):

rm /home/kes/work/projects/artcoin.io/artcoin/.git/MERGE_RR.lock

我继续变相:

git rebase --continue

<强> UPD

我注意到git commit之后的另一件事,尽管有错误消息:

fatal: Unable to create '/home/kes/work/projects/artcoin.io/artcoin/.git/MERGE_RR.lock': File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

提交提交