Certain Git commands such as
git commit require the user to write a short message or make some changes in an external text editor. To determine which text editor to start, Git attempts to read the value of the GIT_EDITOR environment variable, the core.editor configuration option, the VISUAL environment variable, and finally the EDITOR environment variable in this particular order. If none of these options and variables are specified, the git command starts vi as a reasonable default option.
To change the value of the
core.editor configuration option in order to specify a different text editor, type the following at a shell prompt:
scl enable devtoolset-2 'git config --global core.editor command'
Replace
command with the command to be used to start the selected text editor.
Example 7.1. Configuring the Default Text Editor
To configure Git to use
vim as the default text editor, type the following at a shell prompt:
~]$ scl enable devtoolset-2 'git config --global core.editor vim'
In Git, each commit (or revision) is associated with the full name and email of the person responsible for it. By default, Git uses an identity based on the user name and the host name.
To change the full name associated with your Git commits, type the following at a shell prompt:
scl enable devtoolset-2 'git config --global user.name "full name"'
To change the email address associated with your Git commits, type:
scl enable devtoolset-2 'git config --global user.email "email_address"'Example 7.2. Setting Up User Information
To configure Git to use
John Doe as your full name and john@example.com as your email address, type the following at a shell prompt:
~]$scl enable devtoolset-2 'git config --global user.name "John Doe"'~]$scl enable devtoolset-2 'git config --global user.email "john@example.com"'