Eugen Konkov
Eugen Konkov

Reputation: 25113

How to resolve merge conflict while rebasing?

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

I use next commands to resolve conflict:

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

git status after this:

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

But I can not continue rebasing 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.

How to resolve such conflicts and continue rebasing?

Upvotes: 1

Views: 2202

Answers (1)

Eugen Konkov
Eugen Konkov

Reputation: 25113

I resolve it by explicitly doing as last command after those I have done:

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

All commands:

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

After removing this file (because of SegFault):

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

I continue rebasing:

git rebase --continue

UPD

Another thing I have noticed that after git commit despite on error message:

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.

Commit is commited

Upvotes: 1

Related Questions