Configuring user name, email and default editor in git for first time use

The first thing you should do when you install Git is to set your user name and email address. This is important because every Git commit uses this information.

echo -n "Enter your Name : "
echo -n "Enter your Email : "
git config "$GIT_USERNAME"
git config "$GIT_USEREMAIL"

Now, you need to do this only once and available for all gits on the system, you can pass the –global option with above git config commands, like below,

git config --global "$GIT_USERNAME"
git config --global "$GIT_USEREMAIL"

You can configure the default text editor that will be used when Git needs you to type in a message. If not configured, Git uses your system’s default editor.

echo -n "Which editor you want to use? (vim / emacs) "
read usereditor
git config $FORCE_UPDATE --global core.editor $usereditor

If you want to check your settings, you can use the git config –list command to list all the settings

echo "Your configurations has been set for..."
git config --list

You can use our script from github at

Leave a Reply

Your email address will not be published. Required fields are marked *