Menu

Showing posts with label manage multiple user accounts of git. Show all posts
Showing posts with label manage multiple user accounts of git. Show all posts

Manage multiple git accounts in a machine

 While working with multiple Bitbucket or GitLab accounts in a single machine but have a different user name and email, then we can set the local users for a specific repository using the below git commands. By default, Git picks the global user and email that is created in the .gitconfig file. This will help you to check-in the code with the correct user name and email.

Go to the directory path where you cloned the repo and open the GitBash. Run below commands one by one.

git config user.name "Git User1"
git config user.email git-account1@gitaccount.com

After executing the above git config user.name and git config user.email commands, you have done with local user setup for that git repogetory. Now commit a change and using git commit and verify the user name and email with the commit.

Hope this helps you to manage your multiple git accounts.