About
This article shows you how you can configure git to use Notepad as editor on your laptop.
Steps
Create your editor bat script
Git calls a command with one parameter the path of the file.
The command should terminate with the status 1.
Because Notepad will open a new file in its actual process, you should then closed Notepad and your open files each time.
To change this behavior, we wrote a dos script that will wrap the Notepad command invocation.
The script below will open a file in a new instance of Notepad.
@ECHO OFF
REM
notepad++.exe -multiInst %1
Add it to your path environment variable
To be able to call this script from everywhere, you should add it to your PATH environment variable.
In my case, I store all shell scripts that I reuse in the directory D:\code\shell-gt (They are in a git repository and in-sync on all machines).
Configure the new editor command
The last step is to tell git to use our script with git config.
git config --global core.editor ed.bat
Next
That's it.
The next time that Git needs a description (for instance, for a commit), if you don't provide a message at the command line, Git will open Notepad++ asking you
- to write a message,
- to save the file
- and to close Notepad