Reputation: 523
getting error trying to do "git commit -m '...' "
fatal: could not open '.git/MERGE_HEAD' for reading: No such file or directory
I am working on a branch and am trying to pull from master but i need to commit first
Upvotes: 1
Views: 2378
Reputation: 13
The MERGE_HEAD file is there for when you are in the middle of merging two branches. It is likely that your current branch is in a defunct merge state.
If you are using Git > 1.6.1, you can use git reset --merge
to restore your current branch back to the state it was in before the merge.
Then you can commit and finally merge master:
git commit -m "Some message"
git checkout master
git pull origin master
git checkout {branch}
git merge master
Upvotes: 1