3 ms·
I used to do it that way. Recently learned this approach put this in your ~/.gitconfig-personal [core] sshCommand = "ssh -i ~/.ssh/github_personal_ed2551
by qntmfred 3y ago
I used to do it that way. Recently learned this approach
put this in your ~/.gitconfig-personal
[core]
sshCommand = "ssh -i ~/.ssh/github_personal_ed25519"
and this in your ~/.gitconfig-work
[core]
sshCommand = "ssh -i ~/.ssh/github_work_ed25519"
- deleted 3y ago[deleted]
- nickjj 3y agoThis is what I do too, I've written about it in detail at: https://nickjanetakis.com/blog/using-a-custom-ssh-key-to-access-a-private-git-repo https://nickjanetakis.com/blog/using-a-custom-ssh-key-to-acc... You can also set that in your `.git/config` file on a per repo basis. Additionally you can set `GIT_SSH_COMMAND="ssh -i /tmp/custom_key_ed25519 -o IdentitiesOnly=yes" git pull` to override whatever is in your global or repo config for 1 off pulls / clones as a different user.
- nine_k 3y agoThis is indispensable when you have to clone a repo, so no config settings based on being inside a repo do not apply.
- deleted 3y ago[deleted]