Quantcast
Channel: Git | The Linux Juggernaut
Viewing all articles
Browse latest Browse all 16

GIT: How to set or change default editor?

$
0
0

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

The post GIT: How to set or change default editor? appeared first on The Linux Juggernaut.


Viewing all articles
Browse latest Browse all 16

Trending Articles