git: "Warning: Changing a readonly file"

When I go to commit changes to a branch using,

git commit -a

vim is opened and I go to insert my commit message. I get this warning in the terminal:

W10: Warning: Changing a readonly file

In order to continue with the commit, I have to force write using :x! in vim, but otherwise, no problems are encountered.

At the least, this is seems to be just an annoyance. Does anyone know what's going on and/or how to fix this?

I am using Cygwin on Windows 7.

Answers


If the file .git/COMMIT_EDITMSG exists and is read-only, the simplest thing to do is to delete it - git will recreate it as necessary.


I had same problem....but there was a vi instance running still with that file open. No where on the screen i found that instance...so i killed it.


Deleting the file didn't fix it for me. Manually setting the core.editor configuration did. After running this command the problem went away for me.

git config --global core.editor "vim"

I do not know why, but this is what finally resolved the issue. $EDITOR was set to "vim" previously and core.editor was undefined before this fix.


Need Your Help

How to save session in mvc3 on blocked cookies

asp.net asp.net-mvc-3

In my mvc3 application i save data of each user to session.

Where can I find a web-project "security checklist?"

php security xss

I'm looking for a complete list of security guidelines for programming and deploying PHP web sites and applications on an Apache (Linux) server. Basically, a "security check list" to run through be...