Skip to content

Instantly share code, notes, and snippets.

@k4lizen
k4lizen / multiple_git.md
Last active November 28, 2024 15:44
How to manage multiple git accounts with SSH

How to manage multiple git accounts (with SSH)

Guide for windows. Should apply similarly elsewhere. We will use SSH. If you only care about github, check these out: cli/cli#326 & https://github.com/cli/cli/releases/tag/v2.40.0.

The git side

When making a commit, the username and email tagged with the commit are the ones specified in git config user.name and git config user.email. For github at least (but probably for everything else as well), your email is used as your identifier, which connects you as the commit author to your profile on the hosting service.

I like to keep my email private, so the email I connect with my commits to github projects with is the noreply one provided by github. It can be found in github -> Settings -> Emails and looks like [email protected] the number at the beginning being the essentially only important part. If you change the name after the +, github will still recognize it as you, as long as the numbers ar