Windows防火墙,Tinywall和GIT

问题描述 投票:4回答:3

刚刚从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.
git windows-7 windows-firewall
3个回答
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

0
投票

如果Widows上的restarting your shell(在设置白名单后)不起作用,则解决方法是使用端口443进行ssh git会话。 参见this answer,也详见GitHub“using ssh over the https port”。

或者,如果您的服务器支持,您可以尝试切换到https url


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

© www.soinside.com 2019 - 2024. All rights reserved.