Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you abort git merge at the prompt "Please enter a commit message to explain why this merge is necessary."

Tags:

git

Right before pulling I ran git reset HEAD --hard. Then I git pulled and got the message

Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream...

Is it possible to issue a merge --abort from the text editor or after entering a merge message following these instructions or do I have to undo the merge after the merge?

My idea: close the terminal, reopen MINGW and then try merge --abort. Will this leave my local repo corrupted?

like image 987
user5389726598465 Avatar asked Jan 29 '23 18:01

user5389726598465


1 Answers

Generally when git asks you to edit a text file as part of some action, you can abort the action by saving an empty text file. This works for commit messages as well as for, e.g., git rebase -i.

like image 183
amalloy Avatar answered Feb 05 '23 14:02

amalloy