[Solved] Error executing git commit in phpstorm

I thought Git and Phpstorm would work out of the box with minimal configuration. I pointed Git.exe in phpstorm and tried committing a file. To my surprise, I got the following error always.

example is taken from web:

"Error executing git commit --only -F /private/var/folders/bs/zfry67p51_gflf6hqgzplv2xt80189/T/git-commit-msg-5921808149812071312.txt --author=dsedlacek -- web/js/definitions/jquery.d.ts web/js/libs/handlebars-v1.3.0.js web/css/icon...."

And after poking around for a while. I kept git.exe in windows global PATH variable and Phpstorm started working smoothly with Git :).

Solution: Set full path to git.exe to windows environment PATH variable.

Right click on computer > Properties > Advanced system settings > Goto advanced tab then click on “environment variables” > In system variables find the PATH variable edit it and at the end put semicolon and then append the full path to git.exe.

Hope this helps the needy soul :)

Leave a Reply

Your email address will not be published. Required fields are marked *