Git commit error with sublime text 2

I'm taking the How to Use Git and GitHub course at Udacity. I am following the examples but I am having a problem. I've been at it trying to solve the problem with searching and trial and error on my own for about two hours. I think it's time to make a StackOverflow post. I prefer to try and figure out my problem without posting to StackOverflow, but it seems like I'm not productive at the moment and I'm pretty sure this problem is getting a more experienced developer and I could save hours by posting here.And here I am here. I found forum posts on various sites with similar problems that I had and followed the corresponding steps to no avail. Any help or guidance would be appreciated.

So, we learn about Git and make the first Git commit. I am on Windows 7. I am using Git Bash to navigate directories on my computer and execute Git commands. The course allowed us to set the default editor for Git as Sublime Text 2 using the command ...

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

      

Now I go to the appropriate directory using Git Bash and then I execute the Git status and it shows the two files I want in the staging area. All is well and good. But as soon as I try to commit to Git 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 effort :)

+3


source to share


2 answers


I am also taking the same course from udacity and have the same errors. I figured out that the path in the .gitconfig file includes forward slashes in front of the space, but they are not needed. Go to .gitconfig file, you will find your path as C: / Program Files / Sublime \\ Text \\ 2 / sublime_text.exe . Just remove the slashes and do 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 login git commit

+3


source


I fixed my problem by editing the editor value in the .gitconfig file to match the one suggested by @awayken in this StackOverflow article How can I make Sublime Text the default editor for Git? ... I'm not sure why, but this seems to have solved the problem for now.



+2


source







All Articles