Github windows: Commit failed: Failed to create a new commit

This happened to me. Try opening up PowerShell and manually committing each file using the "git add [file name]" command. To see which files have been added, enter "git status" into the command line. The green files have been added, the red ones have not been added.

Once you've added them all, type "git commit." Then go back to Github for Windows and sync it up.

I'm not sure what causes this issue, but once I followed the above steps, Github went back to its normal, awesome behavior.


I had this problem too after an unexpected crash. I couldn't fix using the 'Open Shell' option as suggested. I had to open the Windows CLI (Start -> run -> cmd) and delete the index.lock file in my GitHub folder:

cd \Users\myUser\my\local\github\repo
cd .git
del index.lock

Then when I went back to the GitHub app, it committed successfully.


Note that for some people, according to comments, the file to delete doesn't have the .lock extension, so the delete command could also be del index.

Tags:

Github