【发布时间】:2021-07-13 01:51:12
【问题描述】:
无法让 VS2019 获取/推送到远程(恰好在 GitLab 上)。正确的配置是什么?
-
我正在使用内置的 Windows 10 OpenSSH (
C:\Windows\System32\OpenSSH) -
我已经设置了环境变量
GIT_SSH=C:\Windows\System32\OpenSSH\ssh.exe -
通过
ssh-add将私钥加载到正在运行的ssh-agent服务中。 -
我可以从普通的命令窗口(即,不是 WSL bash shell)推送/获取,让我心满意足。
-
从 VS2019 开始,在 repo 打开 (
Git>Local Repositories>myrepo) 的情况下,当我尝试Git>Fetch或Git>Push时,我会在输出窗口中看到以下内容:Commit eebc0b4a created locally in repository r:\bbits\edu-bitcoin-staging Opening repositories: r:\bbits\edu-bitcoin-staging Pushing master Pushing to gitlab.com:bakins-bits/edu-bitcoin-staging.git Error: cannot spawn C:\Windows\System32\OpenSSH\ssh.exe: No such file or directory Error encountered while pushing to the remote repository: Git failed with a fatal error. Git failed with a fatal error. unable to fork Failed to push to the remote repository. See the Output window for more details.
注意C:\Windows\System32\OpenSSH\ssh.exe: No such file or directory - 然而,这是正确的路径:
C:\>dir C:\Windows\System32\OpenSSH\ssh.exe
Volume in drive C is P70-MSVC
Volume Serial Number is 8240-9525
Directory of C:\Windows\System32\OpenSSH
10/15/2019 06:50 AM 882,688 ssh.exe
1 File(s) 882,688 bytes
0 Dir(s) 333,358,600,192 bytes free
【问题讨论】:
标签: git visual-studio visual-studio-2019 openssh