snippetjavascriptTip
Configure Git's default text editor
Viewed 0 times
configuredefaultgiteditortext
Problem
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
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.Solution
# 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 editorCode Snippets
# 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 editorContext
From 30-seconds-of-code: configure-default-text-editor
Revisions (0)
No revisions yet.