fatal: could not open '.git/COMMIT_EDITMSG': Permission denied
Solution 1:
I solved it by deleting .git/COMMIT_EDITMSG
. Weird, I know.
Solution 2:
This is not an error message from the remote Git repository, this is a problem with your local files. You probably used git (or rake) as another user (such as root) in this same directory, and it created files which you now can't overwrite.
Simply use chown to change the ownership of the files to your current user, for instance:
chown -R $(whoami) .
Solution 3:
If you are working on the bloody Microsoft Windows the error might be due to the fact that you are "watching" the hidden files in the file explorer..that´s it!