- 1 year ago
git default editor on Windows 10
On Windows 10, the default editor for Git can be set using the git config
command. Here's how you can set the default editor:
Open a Git Bash or Command Prompt window.
Set the default editor globally for all Git repositories by running the following command:
bashgit config --global core.editor "<editor>"
Replace
<editor>
with the command or path to your preferred text editor. For example, if you want to use Notepad as the default editor, you can use:bashgit config --global core.editor "notepad"
Alternatively, you can specify the full path to the editor executable if it's not in the system's PATH variable.
Verify the configuration by running:
bashgit config --global core.editor
It should display the configured editor.
Note that the default editor setting is applied globally to all Git repositories on your system. If you want to override the default editor for a specific repository, you can run the git config
command without the --global
flag within that repository's directory.
By setting the default editor using the git config
command, you can specify which text editor Git should use for various operations, such as commit messages, merge conflicts, or interactive rebasing.