Skip to content

Instantly share code, notes, and snippets.

@rahuls360
Last active April 19, 2023 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahuls360/f0e883531e961e649277bcfb302515ed to your computer and use it in GitHub Desktop.
Save rahuls360/f0e883531e961e649277bcfb302515ed to your computer and use it in GitHub Desktop.
Setup multiple Github Accounts on the same machine

References

How to use after the setup

  • By default all github related actions are connected to my work account
    • In Users/myname/.gitconfig -> I have specified my global config. If the folder path is Documents/personal, then I load an additional config file for work (changes my email)
    • In ~/.ssh folder -> I have setup the github remote configuration.
      • By default my ssh key for work will be used.
      • For personal projects, I will modify the remote url, so that this rule can identify differentiate it and load my personal ssh key.
- git clone git@github.com:rahuls360/authentication-demo.git
+ git clone git@github-personal:rahuls360/authentication-demo.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment