刚刚从XP更新到Win7 我正在使用添加了Tinywall的Windows防火墙(提供更多控制权)
但是当我使用Git Bash时,防火墙会阻止所有命令。 如果我禁用防火墙,那么一切正常
我无法确定添加到TinyWall白名单的正确例外。
我添加了shell窗口以及用于应用程序异常的git.exe,但仍然没有。 我添加了这些例外程序路径:
C:\Program Files (x86)\Git\git-cheetah\..\bin\sh.exe
C:\Program Files (x86)\Git\bin\git.exe
错误示例:
$ git pull
ssh: connect to host xxx.xxx.xxx port 22: Bad file number
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
答案 0 :(得分:11)
要让TinyWall通过SSH使用git,你必须列入白名单:
sh.exe
git.exe
ssh.exe
要通过HTTPS使用git,您只需要白名单:
C:\Program Files (x86)\Git\libexec\git-core\git-remote-https.exe
或
C:\Program Files\Git\mingw64\libexec\git-core\git-remote-https.exe
答案 1 :(得分:0)
如果Widows上的restarting your shell(设置白名单后)不起作用,则解决方法是使用端口443进行ssh git会话。
请参阅this answer,详见GitHub" using ssh over the https port"。
如果您的服务器支持,您可以尝试切换到https url。
答案 2 :(得分:0)
在装有TinyWall的Windows 10上,我必须添加以下例外:
C:\Program Files\Git\mingw64\libexec\git-core\git-credential-manager.exe
除了:
C:\Program Files\Git\bin\git.exe
C:\Program Files\Git\bin\sh.exe
C:\Program Files\Git\mingw64\libexec\git-core\git-remote-https.exe