This blog will explain how to set up the editor to work with Git on Windows.
How to Set Up Git Default Editor on Windows?
To set up the Git default editor, follow the given below steps:
- First, open Git bash and switch to the local directory.
- Then, set up the editor using the βgit config core.editor <editor-name>β command
- Finally, verify the default editor through the βgit config core.editorβ or βgit config –listβ command.
Step 1: Move to Local Repository
First, switch to the specific local repository:
Step 2: View Default Editor
Then, view the default configuration setting for the editor:
It can be seen that no default editor has been set for Git:
Step 3: Setup Editor
To set up the new editor, configure the βcore.editorβ setting by using the below-provided command and specify the desired editor name. For instance, we have specified the βnotepadβ editor to work with Git:
Step 4: Verification
Now, ensure that the desired editor has been set as the default editor by running the given-below command:
As you can see the βnotepadβ has been set as the default editor:
Step 5: View Configuration Settings
Lastly, list all the configuration properties to view the default editor settings:
In the below image, the highlighted part shows the default editor value, i.e., βnotepadβ:
We have explained the easiest way to set up an editor to work with Git on Windows.
Conclusion
To set up an editor to work with Git, first, open the Git bash terminal and navigate to the local repository. Then, execute the βgit config core.editor <editor-name>β command to set up the desired editor. After that, verify the default editor using the βgit config core.editorβ or βgit config –listβ command. This blog has explained the method of setting up the editor to work with Git on Windows.