Skip to contentSkip to conversation

update-index --unresolve

DISCUSSION SZEDER Gábor 2 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Dear All,

the documentation says following:

--unresolve::
Restores the 'unmerged' or 'needs updating' state of a file during a merge if it was cleared by accident.

How could I clear those states by accident (or intentionally)?

Thanks,
Gábor

#1 lore raw
Quoted 9 lines · SZEDER Gábor

Dear All,

the documentation says following:

--unresolve::
Restores the 'unmerged' or 'needs updating' state of a file during a merge if it was cleared by accident.

How could I clear those states by accident (or intentionally)?

"git add <file>", or "git update-index <file>", or error in handling merge tool via git-mergetool.

Signature · 3 lines
Jakub Narebski
Poland
ShadeHawk on #git
#2 lore raw

Hi Jakub,

Quoted 9 lines · Jakub Narebski
Quoted 5 lines · SZEDER Gábor

--unresolve::
Restores the 'unmerged' or 'needs updating' state of a file during a merge if it was cleared by accident.

How could I clear those states by accident (or intentionally)?

"git add <file>", or "git update-index <file>", or error in handling merge tool via git-mergetool.

Thanks for your fast reply.

However:

# ...  do a conflicting merge
(master|MERGING)$ echo 4 >one
(master|MERGING)$ git status
one: needs merge
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working
#   directory)
#
#       unmerged:   one
#
no changes added to commit (use "git add" and/or "git commit -a")
(master|MERGING)$ git add one
(master|MERGING)$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   one
#
(master|MERGING)$ git update-index --unresolve
(master|MERGING)$ echo $?
0
(master|MERGING)$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   one
#

So, as you can see, after 'add ; update-index --unresolve' the file is not marked as unmerged, but it's still ready to be committed.

Is something wrong going on here, or it is indeed the intended behaviour and I misunderstood this functionality?

Thanks,
Gábor

#3 lore raw
Quoted 22 lines · SZEDER Gábor
Quoted 4 lines
Quoted 1 line

How could I clear those states by accident (or intentionally)?

"git add <file>", or "git update-index <file>", or error in handling merge tool via git-mergetool.

Thanks for your fast reply.

However:

# ...  do a conflicting merge
(master|MERGING)$ echo 4 >one
(master|MERGING)$ git status
one: needs merge
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working
#   directory)
#
#       unmerged:   one
#
no changes added to commit (use "git add" and/or "git commit -a")
(master|MERGING)$ git add one
Quoted 8 lines
(master|MERGING)$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   one
#
(master|MERGING)$ git update-index --unresolve

Ah, that should be 'git update-index --unresolve one', and everything works as expected.

Sorry,
Gábor