When running the command git reset --soft HEAD^
in my repository, the terminal tells me it is in the middle of a merge:
fatal: Cannot do a soft reset in the middle of a merge.
But when trying to abort the merge with git merge --abort
, the terminal states that there is no merge:
fatal: There is no merge to abort (MERGE_HEAD missing).
Is there a "hidden" merge in git of some sort? I don't know much about how git works and am not sure how to fix this. If I run git reset --hard HEAD
will the changes I made to the files still be saved and I just have to restage and commit them?
git merge --abort is equivalent to git reset --merge when MERGE_HEAD is present. After a failed merge, when there is no MERGE_HEAD , the failed merge can be undone with git reset --merge , but not necessarily with git merge --abort .
You can use the git reset --merge command. You can also use the git merge --abort command.
Go to the merge request you want to delete, and select Edit. Scroll to the bottom of the page, and select Delete merge request.
Partial answer: you'll lose all the changes you made while running git reset --hard
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With