![]() ![]() You’ll need this a couple of times later so remember it or use a password manager. Key gen will prompt you for a password twice. Use something memorable like workaccount-github or personalaccount-github Ssh-keygen -t ed25519 -C gen will prompt you for a filename. # Now generate a certificate for each GitHub account you need ![]() ![]() # navigate to the ssh directory cd ~/.ssh You could just use one certificate representing your computer here but I personally like to use different certificates per account. If you just want ssh on one github account then you only need to run keygen once. Note: not each repository, you just need a cert for each GitHub account. Navigate to the directory and run the command below for each GitHub account. If you’re on another OS check google for the correct location. I find it’s easier to do all this stuff directly in the ssh configuration for your account. Update each git repository to use the correct ssh key.Configure ssh on you computer and on each github account.You can have multiple github accounts on the same machine and you never have to remember to swap between them. Why use ssh? - You will always have the same user in every client app you use git with for a repository. If you want to use the same connection authentication for a git repository from any git client like shell, source tree or the GitHub client then it’s worth setting up ssh for the GitHub account(s) and configuring the repositories to use it. Using http authentication also often means that a different user will be used in shell git compared to your GUI client. If you have multiple GitHub accounts like personal and work then it’s important to use the correct account for each repository so you don’t accidentally commit to one with the wrong GitHub account!.Įach git client has built in ways to do this with http authentication but http authentication tends to only be set with the specific git client and applies to all repositories you have in the specific application. Follow me on twitter for more posts like this ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |