简体   繁体   English

无法访问 Windows 的 GIT_SSH_COMMAND 中的身份文件

[英]Identity fie in GIT_SSH_COMMAND for Windows not accessible

This command not working for me.这个命令对我不起作用。 I need to pass tmp identity file to ssh (git):我需要将 tmp 身份文件传递给 ssh (git):

set "GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no -F /dev/null -o IdentitiesOnly=yes -i C:\Users\some_user\AppData\Local\Temp\git-ssh-key" & git clone git@some_repo.git

I get a Warning:我收到警告:

Identity file C:Userssome_userAppDataLocalTempgit-ssh-key not accessible: No such file or directory.

When I try double backslash in identity file path, got a error:当我在身份文件路径中尝试双反斜杠时,出现错误:

debug1: Trying private key: C:\\Users\\assorvin\\AppData\\Local\\Temp\\git-ssh-key Load key "C:\\Users\\some_user\\AppData\\Local\\Temp\\git-ssh-key": invalid format

I made it work using linux-style path with我使用linux风格的路径使它工作

set "GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no  -F /dev/null -o IdentitiesOnly=yes -i /C/Users/some_user/AppData/Local/Temp/git-ssh-key"&&  git clone git@some_repo.git

Note the lack of space before the && : it avoid adding an extra space to the previous command, which can be sometimes problematic.请注意&&之前缺少空格:它避免在前一个命令中添加额外的空格,这有时可能会出现问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM