0

I am trying to set up git on my terminal, and need it to open up Sublime text when I use a git commit command, so that I can add a note to my commits. If I type "subl" sublime opens up fine, however when I type git commit the following error message comes up

hint: Waiting for your editor to close the file... '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl' -n -w: /Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl: No such file or directory error: There was a problem with the editor ''/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl' -n -w'. Please supply the message using either -m or -F option.

I have been following a Udacity git and github course which explains set up.

I am wanting sumblime text editor to open so I can type a note for my commits. However instead it is asking that I use -m to type a note which isn't always going to be convenient.

CThomas
  • 199
  • 1
  • 10
  • 4
    Possible duplicate of [How can I make Sublime Text the default editor for Git?](https://stackoverflow.com/questions/8951275/how-can-i-make-sublime-text-the-default-editor-for-git) – phd Apr 23 '19 at 19:13
  • https://stackoverflow.com/search?q=%5Bgit%5D+%5Bsublimetext%5D+default+editor – phd Apr 23 '19 at 19:13

2 Answers2

0

You have to set up sublime text 3 as your default editor through the terminal.

run this: git config --global core.editor "subl -n -w"

  • This was already answered on stackoverflow. https://stackoverflow.com/questions/8951275/how-can-i-make-sublime-text-the-default-editor-for-git – marcogmonteiro Sep 30 '20 at 21:02
0
git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl --new-window --wait
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77