Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Source Tree GIT - How to cancel a merge [duplicate]

Started a merge between branches in source tree and changed my mind. Wanted to redo the merge but am getting the error when starting the merge again :

"fatal: You have not concluded your merge (MERGE_HEAD exists).Please, commit your changes before you merge."

Error

I cannot see any un-committed files but when clicking the "Commit", I get the previous merge changes.

How do I cancel this merge ?

like image 595
Yigal Omer Avatar asked Apr 10 '18 09:04

Yigal Omer


People also ask

How do I terminate a merge in Sourcetree?

Select conflicts in staged files, and select discard. 5. After discarding, Sourcetree will silently abort the merge, clear the file status screen and also discard any successfully merged files.

How do you terminate a merge?

How do I cancel a git merge? Use git-reset or git merge --abort to cancel a merge that had conflicts. Please note that all the changes will be reset, and this operation cannot be reverted, so make sure to commit or git-stash all your changes before you start a merge.

How do I undo a remote merge?

simply run git reset --hard to revert all those changes.


1 Answers

You are in the merge process. If you need to abort the merge, You need to get out of the merge by using git merge --abort.

If not do a git status git status to figure out what the conflicts and changes are and then commit those changes to continue with the merge.

like image 140
Yogesh_D Avatar answered Sep 21 '22 01:09

Yogesh_D