How can I make Sublime Text the default editor for Git?
Asked 07 September, 2021
Viewed 2K times
  • 51
Votes

I have a problem setting Sublime Text 2 as the core.editor with git.

I've read through every post I could find addressing the problem, but still nothing is working for me. I am running Windows.

I have done:

git config --global core.editor "'C:/Program Files/Sublime Text 2/sublime_text.exe'"

and tried that with various arguments like -m. When I open my .gitconfig, this is what is in there:

[user]
    name = Spencer Moran
    email = [email protected]
[core]
    editor = 'C:/Program Files/Sublime Text 2/sublime_text.exe'

If I go to Git and type:

README.markdown --edit

the README file opens in Notepad, not Sublime Text.

Does anyone have any idea what I'm doing wrong or how I could fix this?

16 Answer