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.
Latest posts by Surendra Anne (see all)
- Docker: How to copy files to/from docker container - June 30, 2020
- Anisble: ERROR! unexpected parameter type in action:
Fix - June 29, 2020 - FREE: JOIN OUR DEVOPS TELEGRAM GROUPS - August 2, 2019
- Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) - August 27, 2018
- How to use ohai/chef-shell to get node attributes - July 19, 2018