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.)

2
  • 1
    Should notepad.exe be notepad2.exe? And do you have the correct path to the executable? Commented Feb 19, 2018 at 16:58
  • Nah, I used the installation option that replaces Windows Notepad with Notepad2. It works fine if I omit the command line part. Commented Feb 19, 2018 at 17:01

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.