How to Set Git Repository-specific User Credential Configuration
Sometimes, we may have more than one GitHub accounts, for example, one personal and another for a group.
If we are maintaining a particular repository of that group, we may need to change the default username and password, which is usually set for our personal account.
In that case, we can set repository-specific username and password so that it doesn’t cost us time while pulling or pushing repository updates.
In this post, I will show how to set repository-specific user credentials.
set repository-specific username/email configuration
- change username
git config user.name "FIRST_NAME LAST_NAME"
- change email address:
git config user.email "MY_NAME@example.com"
Change it back to Ask Password
git config credential.${remote}.username yourusername
git config credential.helper store
Leave a comment