The argument “-i” passed to GIT_SSH_COMMAND is being ignored

后端 未结 2 1540
我寻月下人不归
我寻月下人不归 2021-02-15 02:07

I want to use other IdentityFile for git. I want to use it dynamically, not via config. I\'m doing this:

  $ GIT_SSH_COMMAND=\'ssh -i /home/my_user/.ssh/id_ed255         


        
2条回答
  •  野的像风
    2021-02-15 02:29

    I had the same issue with the recent Ubuntu version:

    Using -vvv revealed following:

    debug2: key: /home/ubuntu/.ssh/id_rsa (0x5628e48246d0), agent
    debug2: key: /home/ubuntu/code/id_rsa (0x5628e4820af0), explicit
    

    Adding -o IdentitiesOnly=yes solved it.

    Full git command:

    GIT_SSH_COMMAND='ssh -o IdentitiesOnly=yes -i /home/ubuntu/code/id_rsa -F /dev/null' git pull
    

提交回复
热议问题