2

I'm using Notepad2 as my Git commit editor. It has a command-line option to change the syntax scheme, like so:

notepad2.exe /s Diff Files

I'm using verbose commits in Git, and I want to select the diff scheme when I get ready to commit. But I can't figure out the right command. I would think it would be something like this (in .gitconfig):

[core]
    editor = C:/Windows/System32/notepad.exe /s Diff

But Git reads that whole line as the file name and then tells me it can't find the notepad.exe /s Diff file anywhere.

How can I get Git to consider the /s Diff as a command line option, not part of the file name?

(I'm using Windows 10 and the Windows command prompt.)

Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211

1 Answers1

1

Following a similar pattern as "How can I make Sublime Text the default editor for Git?"

git config --global core.editor "'c:/Windows/System32/notepad.exe' -s Diff"

From "git: Show index diff in commit message as comment", it is -s, not /s.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250