How to Use Notepad++ in Git


git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"


Git may be a versioning tool, but it does require a text editor for things like commit messages. If you have used Git on Windows from the command line, you may be familiar with this screen:

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be commited:
#   (use "git reset HEAD <file>..." to unstage)
#       modified:   foo.c
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be commited)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#       new file:   bar.h
# Untracked files:
#   (use "git add <file>..." to include in what will be commited)

This is Vim, a popular text editor on Linux. It comes with Git for Windows, which defaults to Vim for any text editing.

If you’re stuck there, like so many others, rest assured: It’s not your fault. Exiting Vim is so counter-intuitive that it’s one of the most popular StackOverflow questions of all time!

StackOverflow question: How do I exit Vim?

Surely there must be a better way for us Windows users.

Changing the Text Editor

Git is very flexible, and it permits to use other text editors besides Vim – the latter just being provided as a default.

The magic is in the git config core.editor command.


First of all: Install Notepad++. Duh!

Remember Notepad++’s location. If you haven’t changed the defaults, it should be C:/Program Files/Notepad++/notepad++.exe. Use it in a command prompt like so:

git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"

After successfully running this command, Git should spawn Notepad++ whenever it asks you for a commit message:

Git commit in Notepad++

Edit and save the file normally. Git resumes once you close Notepad++.