Thursday, 8 August 2019

GIT: HOW TO SET OR CHANGE USERNAME AND E-MAIL?

When 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.

0 comments:

Post a Comment