hen we are using GIT, it’s advaisable to set username and e-mail so that we no need to set them everytime we use GIT to do changes. This post will show you on how to set username and e-mail for editing data with in git.

Check if there is any username and email set for your login to use GIT?
To know it we have to use git command or open ~/.gitconfig file.

Checking user name and password is set or not using git config command

	git config user.name
git config user.email

Output:

	○ → git config user.name
Surendra Anne

And for email

	○ → git config user.email
surendra.anne@xyz.com

or check in ~/.gitconfig file for information

	grep -E 'name|email' ~/.gitconfig

How to set user name and e-mail for your login.

	git config --global user.name "your user name"
git config --global user.email "Your e-mail"

Examples:

	git config --global user.name "John who"
git config --global user.email "john.who@linuxnix.com"

Again to check these settings are saved or not open ~/.gitconfig file and see the changes.

The following two tabs change content below.
Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.