Last active
August 19, 2016 03:04
-
-
Save KrashLeviathan/3cd7d861eea4c9571ad033dd196a47be to your computer and use it in GitHub Desktop.
How to Work with GitHub and Multiple Accounts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Got this handy tidbit from Jeffrey Way on tutsplus.com | |
# http://code.tutsplus.com/tutorials/quick-tip-how-to-work-with-github-and-multiple-accounts--net-22574 | |
# This file goes in your $HOME/.ssh directory | |
# Default GitHub account (work or school) | |
Host github.com | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_rsa | |
# Secondary GitHub account (personal projects) | |
Host github-krashleviathan | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_rsa_krashleviathan | |
# Make sure to create an ssh key for your personal account, and name it `id_rsa_krashleviathan` | |
# Then, make sure when you add remotes for personal projects, use: | |
# git remote add origin git@github-krashleviathan:KrashLeviathan/my_sweet_project.git | |
# If you get the `ERROR: Permission denied to...` message, you probably need to | |
# add the ssh key again with `ssh-add ~/.ssh/id_rsa_krashleviathan` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment