MareOfNights@discuss.tchncs.de to Programmer Humor@lemmy.ml · 1 year agoCorrectiondiscuss.tchncs.deimagemessage-square8fedilinkarrow-up1431arrow-down121file-text
arrow-up1410arrow-down1imageCorrectiondiscuss.tchncs.deMareOfNights@discuss.tchncs.de to Programmer Humor@lemmy.ml · 1 year agomessage-square8fedilinkfile-text
minus-squarelowleveldata@programming.devlinkfedilinkarrow-up11arrow-down1·1 year agoI don’t post my code to Github because I still couldn’t figure out how to switch SSH keys for 2 different git servers smoothly.
minus-squarePerhyte@lemmy.worldlinkfedilinkEnglisharrow-up8·1 year agoIf you’re using OpenSSH, the IdentityFile configuration directive selects the SSH key to use. Add something like this to your SSH config file (~/.ssh/config): Host github.com IdentityFile ~/.ssh/github_rsa Host gitlab.com IdentityFile ~/.ssh/gitlab_rsa This will use the github_rsa key for repositories hosted at github.com, and the gitlab_rsa key for repositories hosted at gitlab.com. Adjust as needed for your key names and hosts, obviously.
minus-squarequantenzitrone@feddit.delinkfedilinkarrow-up1·1 year agoyou dont have to switch git will automatically select one that works I have the same password protected ssh key for every git site i am on tho. The sites only know the public key so its fine.
I don’t post my code to Github because I still couldn’t figure out how to switch SSH keys for 2 different git servers smoothly.
If you’re using OpenSSH, the
IdentityFile
configuration directive selects the SSH key to use.Add something like this to your SSH config file (
~/.ssh/config
):This will use the
github_rsa
key for repositories hosted atgithub.com
, and thegitlab_rsa
key for repositories hosted atgitlab.com
. Adjust as needed for your key names and hosts, obviously.you dont have to switch
git will automatically select one that works
I have the same password protected ssh key for every git site i am on tho. The sites only know the public key so its fine.