1

I want to do this command in one line: git pull && [path to ssh key]

How to do it?

Follow up to this question

Peter PitLock
  • 1,823
  • 7
  • 34
  • 71

1 Answers1

0

Option 1: Environment Variables

set GIT_SSH_COMMAND=ssh -i /some/dir/somekey & git pull & set GIT_SSH_COMMAND=

Option 2: SSH client config

If you are intending to use this key with this server more often, you could configure your SSH client to always use this key to authenticate with this Git server. For OpenSSH, add a Host section to your SSH client config, and specify the key with the IdentityFile parameter:

Host <gitserver>
    User <gituser>
    IdentityFile /some/dir/somekey

Option 3: Git config

As Thiru suggested: git config core.sshCommand ...

sborsky
  • 425
  • 2
  • 8