windows - 无法在 WSL 中使用 git。 C :\Windows\System32\OpenSSH\ssh. exe:未找到

标签 windows git ssh windows-subsystem-for-linux

所以我在 Windows 10 上,不久前我决定使用 WSL,这样我就可以获得 zsh。但是,现在我不能再从我的 wsl 终端使用 git,即我不能再 git pull来自远程仓库。当我尝试时,我得到以下...

'C:\Windows\System32\OpenSSH\ssh.exe': 1: C:\Windows\System32\OpenSSH\ssh.exe: not found
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
此类操作在 bash 和来自 GitHub Desktop 中运行良好.为什么 WSL 尝试从 Windows 使用 OpenSSH,它应该是 Linux,对吗?
我正在努力寻找有关此问题的信息,因此非常感谢任何帮助。如果我能提供更多信息,请告诉我。

最佳答案

像这样更改值“core.sshCommand”后,我遇到了同样的错误:

git config --global core.sshCommand "'C:\Windows\System32\OpenSSH\ssh.exe'"
在我的文件 ~/.gitconfig 中,我禁用了如下换行符:
#[core]
#       sshCommand = 'C:\\Windows\\System32\\OpenSSH\\ssh.exe'
然后,当您在 git 存储库中时,如果您遇到相同的问题,请检查您的 my-project/.git/config 文件,如果有新配置,请按上述方式禁用它。
就我而言,它有效:-)
祝你今天过得愉快

关于windows - 无法在 WSL 中使用 git。 C :\Windows\System32\OpenSSH\ssh. exe:未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67778455/

相关文章:

macos - 自动同步 Git 到 SVN

Git LFS : Error: failed to push some refs to

java - spark standalone cluster slave无法将slave连接到master

windows - 传递 CString 后跟 int 时 FFI 中的错误

java:在Windows Eclipse中编译具有相同名称但大小写不同的文件

python - 谷歌云功能 - ImportError : cannot import name 'pubsub' from 'google.cloud' (unknown location)

php - Magento 安装向导错误

android - 以编程方式使用 SSH Android

c++ - 将 Unicode 命令行参数传递给控制台应用程序

windows - Active Directory 中是否存在任何主键(或)唯一键?