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 : "
read GIT_USERNAME

echo -n "Enter your Email : "
read GIT_USEREMAIL

git config user.name "$GIT_USERNAME"
git config user.email "$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 user.name "$GIT_USERNAME"
git config --global user.email "$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 https://github.com/lynxbee/working-with-git/blob/master/git-setup-configs.bash

Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home 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 NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem 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
Tags:

Leave a Reply