Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git commit error with sublime text 2 [duplicate]

I'm taking the course "How to Use Git and GitHub" on Udacity. I'm following along with the examples but I've run into a problem. I've been at it trying to fix the problem via googling and trial and error by myself for about two hours. I think it's about time to make a StackOverflow post. I prefer trying to figure out my issue without posting on StackOverflow, but it seems at this point, I'm not being productive and I'm sure this issue is a gotcha for a more experienced developer and I could save hours by posting here, so here I am. I've found forum posts on varying sites with similar issues to mine and have followed the appropriate action to no avail. I would appreciate any help or guidance.

So, we are learning about git and doing our first git commit. I'm on Windows 7. I'm using Git Bash to navigate through the directories on my computer and to do git commands. The course had us set the default editor for Git to be Sublime Text 2 with the command...

git config --global core.editor "'C:/Program Files/Sublime Text2/sublime_text.exe' -n -w"

Now, I navigate to the appropriate directory using Git Bash and then I do a git status and it shows the two files I want in the staging area. All is fine and well. But as soon as I try to do a git commit, I get the following error...

'C:/Program Files/Sublime Text2/sublime_text.exe' -n -w: C:/Program Files/Sublim
e Text2/sublime_text.exe: No such file or directory
error: There was a problem with the editor ''C:/Program Files/Sublime Text2/subl
ime_text.exe' -n -w'.
Please supply the message using either -m or -F option.

Please help!!!

Thanks in advance for your time and efforts :)

like image 478
JulianDavid Avatar asked Aug 12 '26 19:08

JulianDavid


1 Answers

I am also taking the same course from udacity and have the same errors . I figured out that the path in .gitconfig file includes slashes before space but they aren't needed . Go to the .gitconfig file , you will find your path as C:/Program Files/Sublime\\ Text\\ 2/sublime_text.exe . Just remove the slashes and make it C:/Program Files/Sublime Text 2/sublime_text.exe.

Now the error of providing message using -m will go away and sublime will open on entering git commit

like image 58
Dhyey Avatar answered Aug 15 '26 10:08

Dhyey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!