jackblk / config

my config
0 stars 0 forks source link

Configure ssh key for repo/global #24

Open jackblk opened 1 year ago

jackblk commented 1 year ago

Set globally:

git config  --global core.sshCommand "ssh -i ~/.ssh/jackblk4_id_ed25519 -o 'IdentitiesOnly yes'"

Set for repo:

git config core.sshCommand "ssh -i ~/.ssh/example -o 'IdentitiesOnly yes'"

To clone easily, use this alias

alias myalias=export GIT_SSH_COMMAND="ssh -i ~/.ssh/keyhere"

Then clone normally


Refs

https://stackoverflow.com/questions/4565700/how-to-specify-the-private-ssh-key-to-use-when-executing-shell-command-on-git