0

I need to do a git pull specifying the private key, like:

git pull git@github.com:User/Repository.git -key "~/git_key"

I know that I can set the key on "~/.ssh/authorized_keys", but I don't want to set the key global, only to specify the key on the git command.

Is it possible to do?

Thanks

phd
  • 82,685
  • 13
  • 120
  • 165
  • https://stackoverflow.com/search?q=%5Bgit%5D+specify+SSH+key – phd Aug 29 '21 at 17:40
  • See https://stackoverflow.com/a/29754018/7976758: `GIT_SSH_COMMAND='ssh -i ~/git_key -o IdentitiesOnly=yes' git pull git@github.com:User/Repository.git` – phd Aug 29 '21 at 17:41

0 Answers0