Skip to main content

Git: Working with Multiple Accounts

Table of Contents

The Problem

If you are in a situation like I am where you have multiple GitHub accounts and you want to work with them on the same machine, it can be a big pain handling the github credentials while working with repos from two different accounts.

The Solution

The solution is to use the Git Credential Manager which is a cross-platform tool that manages your credentials for you. It let's you login to your GitHub accounts through the browser and then stores the credentials for you.

After you have followed the instructions to login to your first account, you simply run the following command:

git credential-manager github login

And login with your second account. Now when you interact with your repos it will ask you which account you want to use, and you just select the one that is authorized for that repo.

Comments

Recent Work

Free desktop AI Chat client, designed for developers and businesses. Unlocks advanced model settings only available in the API. Includes quality of life features like custom syntax highlighting.

Learn More

BidBear

bidbear.io

Bidbear is a report automation tool. It downloads Amazon Seller and Advertising reports, daily, to a private database. It then merges and formats the data into beautiful, on demand, exportable performance reports.

Learn More