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

Android Android Commands Android Java Applications Application Libraries Application Stack / User Interface Bash / Shell Scripts Commands and Packages Compilation Content Management System - CMS Core Kernel C Programs Development & Build Development Environment Setup Errors & Failures git Go Language Programs Hardware Platforms HTML JAVA Programs Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Monetization / Google AdSense Moodle NDK / Middleware / HAL OS Concepts PHP Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply / Ask Question