Last active
January 16, 2023 09:15
-
-
Save SerkanSipahi/10d4249910f35aee6f86184201d3eeaa to your computer and use it in GitHub Desktop.
multiple git 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
# global | |
Host * | |
AddKeysToAgent yes | |
UseKeyChain yes | |
IdentityFile ~/.ssh/id_rsa_home | |
ForwardAgent yes | |
# GitHub home | |
# Example usage: git clone git@id_rsa_home:myPrivateGitName/example.git | |
# Usage: | |
# - git clone git@id_rsa_home:myPrivateGitName/example.git | |
# - git config user.name "my private gitname" | |
# - git config user.email "myemail@example.com" | |
Host id_rsa_home | |
HostName github.com | |
User myPrivateGitName | |
PreferredAuthentications publickey | |
IdentityFile ~/.ssh/id_rsa_home | |
# GitHub work | |
# git clone git@id_rsa_work:myWorkGitName/example.git | |
# Usage: | |
# - git clone git@id_rsa_work:myWorkGitName/example.git | |
# - git config user.name "my work gitname" | |
# - git config user.email "myemail@example.com" | |
Host id_rsa_work | |
HostName repo.of.work.com | |
User myWorkGitName | |
PreferredAuthentications publickey | |
IdentityFile ~/.ssh/id_rsa_work | |
# source: https://elmland.blog/2018/08/13/multiple-git-acc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment