Suppose you are working for two different companies and you want to commit code with different credentials i.e. user name and user email. Git commit will by default pick the configuration from your home directory
How To Override Credentials For Project
To override setting for project you should navigate to desired directory on terminal and set configuration individually as follows specific to your project
git config user.email "email@example.com" git config user.name "Gulshan Saini"
To confirm the changes, execute below commands on terminal
git config user.email // Output: firstname.lastname@example.org git config user.name // Output: Gulshan Saini
Bonus Tip You can view complete list of local configuration using below command
git config --local --list