局域网git搭建显示路径错误
局域网内搭建windows主机上的git仓库,在无论是push还是clone远程仓库,都会显示:
fatal: ''repos/mypro.git'' does not appear to be a git repository
fatal: Could not read from remote repository.
排除路径错误,ssh登陆用户无权限,以及其他可能的拼写问题。
可能是Windows上的Openssh默认使用cmd,而cmd不支持unix风格的路径以及类linux风格的路径,在管理员权限下的powershell运行以下代码,将Openssh默认shell换成powershell
Set-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
然后重启ssh
Restart-Service sshd
之后在git命令的所有路径上添加双引号"",类似下面这种,即可解决问题。
git clone ssh@localhost:"E:/GitRepos/mypro.git"
9247

被折叠的 条评论
为什么被折叠?



