Skip to content

Home

Configure Git's default text editor

Tired of having to use the terminal when Git prompts you to enter a commit message? You can configure the text editor used by Git to make the process more convenient. This way, you can use your favorite text editor to write commit messages and other text editing tasks.

In order to do so, you can use git config --global core.editor <editor-command> to set the text editor used by Git. Replace <editor-command> with the command that opens your preferred text editor.

# Usage: git config --global core.editor <editor-command>

git config --global core.editor "code --wait"
# Sets VS Code as the git text editor

git config --global core.editor "vim"
# Sets Vim as the git text editor

git config --global core.editor "subl --wait"
# Sets Sublime Text as the git text editor

More like this

Start typing a keyphrase to see matching snippets.