I want to do this command in one line: git pull && [path to ssh key]
How to do it?
Follow up to this question
set GIT_SSH_COMMAND=ssh -i /some/dir/somekey & git pull & set GIT_SSH_COMMAND=
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
As Thiru suggested: git config core.sshCommand ...