- Create a separate ssh key for your new user via ssh-keygen
- Update your current user .ssh/config file
- Update each project .git/config as in example
Created
April 2, 2024 12:47
-
-
Save AidasK/a4853249a71e5dd3a2c10f46cb4e48d3 to your computer and use it in GitHub Desktop.
Working with multiple github users on different projects
This file contains hidden or 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
// .git/config file example, update each project | |
[remote "origin"] | |
url = [email protected]:repo-namespace/reponame.git | |
fetch = +refs/heads/*:refs/remotes/origin/* |
This file contains hidden or 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
// .ssh/config file example | |
Host gitlab.com-CUSTOMUSER | |
Hostname gitlab.com | |
User git | |
UseKeychain yes | |
IdentityFile ~/.ssh/id_rsa_CUSTOMUSER | |
Host * | |
UseKeychain yes | |
AddKeysToAgent no | |
IdentityFile ~/.ssh/id_rsa |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment