Git merge termination - Best practice

Suppose you are in a branch topic, you have been working for some time and want to merge some commits from master.

You run git merge, and there are several conflicts. But now you do not have time to resolve merge conflicts, and you want to return to the state you were in before starting git merge.

There are three ways that I know for this:

  • git merge --abort
  • git reset --merge
  • git reset --hard HEAD?

Is any of the three acceptable? What is the difference between the two in this case?

+4
source share
1 answer

git merge --abort git reset --hard HEAD, ( git merge man page) it .git/MERGE* (, MERGE_HEAD).
git reset --hard , , git , .

git reset --merge - , , git merge --abort ( git 1.7.4, ).

+3

Source: https://habr.com/ru/post/1541266/


All Articles