【问题标题】:Windows Firewall, Tinywall and GITWindows 防火墙、Tinywall 和 GIT
【发布时间】:2014-07-20 20:20:42
【问题描述】:

终于从 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


    【解决方案1】:

    要让 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
    

    【讨论】:

    • 如果您使用 Atlassian 的 SourceTree 看到 OP 中描述的错误,请将 C:\Program Files (x86)\Atlassian\SourceTree\tools\putty\plink.exe 列入白名单,这解决了我的问题。
    【解决方案2】:

    在带有 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

    【讨论】:

    • 这个和this answer基本一样。请不要转发答案。
    【解决方案3】:

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

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

    【讨论】:

    • 不知道服务器是否支持https url(对git还不是很熟悉)。我希望能够以某种方式解除对这些端口的阻塞,而不是解决问题。
    • @Karen 该服务器是已知的 git 托管 repo 服务吗? (如 GitHub 或 BitBucket)。还是私服?
    • VonC - 私人托管
    猜你喜欢
    • 2013-07-25
    • 1970-01-01
    • 1970-01-01
    • 2014-12-05
    • 2012-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多