Every user have their favorate editor. Some use VI other uses emacs. This post will help you on how to see what is the text editor in GIT and how change it to your favorate editor. Changing an editor is done in many ways for GIT, either we can edit main git configuration file ~/.gitconfig or we can use "git config" command to set it.
So what is my default editor for my git?
To know it we have to use git command or open ~/.gitconfig file.
git config core.editor
Output:
○ → git config core.editor
vim
or
grep editor ~/.gitconfig
Output:
editor = vim
Change default GIT editor to your favorate one with a command
git config --global core.editor editor_name
Example: I want to set vim as my default editor to do that follow below command
git config --global core.editor vim
change default GIT editor by editing ~/.gitconfig
Enter below entry in to the file under [core] section
editor = vim
Check if your editor is updated or not with following commands
git config core.editor
or
grep editor ~/.gitconfig
Latest posts by Surendra Anne (see all)
- Docker: How to copy files to/from docker container - June 30, 2020
- Anisble: ERROR! unexpected parameter type in action:
Fix - June 29, 2020 - FREE: JOIN OUR DEVOPS TELEGRAM GROUPS - August 2, 2019
- Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) - August 27, 2018
- How to use ohai/chef-shell to get node attributes - July 19, 2018