Re: Interpreting git merge failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Scott Bronson <bronson@xxxxxxxxxxx> writes:

> What is the best way to determine why a git merge failed?

If you get exit code 0, the merge did not fail.

Otherwise you can inspect the index after getting the non-zero exit code.

If you have an unmerged entry in the index, there could be two cases.  The
most typical is that the merge was attempted and stopped due to an
conflict. "ls-files -u" will show these paths. Another is a user error to
run "git merge" when your index is already unmerged, but you can easily
avoid this at the beginning of your script, stopping without running "git
merge" when the index is unmerged to begin with.

If you do not have an unmerged entry in the index, the merge refrained
from overwriting either your local modifications in the working tree, or
your local modifications to the index.  Again the latter is a user error
that you can detect before running "git merge" in your script.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]