Git Configuration. - 4

We will set up a simple configuration to add the common information for each commit. Here username and email have been set up.

Git Logo

Case 1 (Globally): If you would like to set up a user name and email globally, this user name and email would be added to the entire git repository in your machine for each commit. Then follow the below command.

  • Open cmd/Git Bash 

git            --global user.name "Roman Sarker"
git config --global user.email "roman@yahoo.com"


Case 2 (Specific Project):  If you want to set up a username and email for a particular project. Then follow the below command. Here just remote the hyphen (--) .

  • Open Git Bash 
  • Go to the Project Folder in Git Bash
  • Initialize the project
  • Set username 
  • Set email
Commands - 
git init
git   config user.name "Roman Sarker"
git   config user.email "roman@yahoo.com"


Command Image

 Done. Now you can see the username and email in every commit log.

Post a Comment

0 Comments