I use git, as the version control system both at my workplace and to store my personal code (including the source of this blog). I use different e-mails for personal and work repositories, as well as different SSH keys for different accounts (this is because Github, at least, does not allow different accounts to use the same key, which I was not sure of, but Ariel confirmed on fedi). After a bunch of trial-and-error, I have figured out a way to do ssh for two different github accounts using different keys on the same device. The .sshconfig looks a bit like this: Host work User git HostName github.com IdentityFile ~/.ssh/id_work_github Host personal User git HostName github.com IdentityFile ~/.ssh/id_personal_github So, if I want to clone a work repo, I need to do git clone work:<WorkOrg>/<RepoName>.git, and if I want to do the same using my personal account, git clone personal:<Org>/<RepoName>.git, and it just works. I have to remember to use the correct prefix, work or personal, and…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.