【问题标题】:Using smartgit behind a proxy在代理后面使用 smartgit
【发布时间】:2015-08-25 10:00:01
【问题描述】:

我正在使用公司代理(带有凭据)以访问 Internet,我想访问外部托管的 git 存储库,该存储库使用 smartgit 为windows

我的存储库托管在 mygit.be,我的代理位于端口 8080 上的 10.30.30.30,用户 totomygit.be 可通过端口 25000 上的 ssh 访问,用户 git 和 @ 987654330@.

在互联网上进行大量搜索后,我添加了一个指向c:\Users\toto\HOME 环境变量。我还在c:\Users\toto\.ssh 中复制了我的私钥。最后,我在c:\Users\toto\.ssh 中创建了一个config 文件,其中包含

Host mygit.be
  ProxyCommand connect -H toto@10.30.30.30:8080 %h 25000
  IdentityFile ~/.ssh/id_rsa_git

现在使用

c:\Program Files\SmartGit\git\bin\git.exe ls-remote ssh://git@mygit.be:25000/~/myrepository.git refs/heads/*

工作正常。它询问我代理密码然后给我结果。

Enter proxy authentication password for toto@10.30.30.30:
b21e99487808231c992d50ca6bef483bea788708        refs/heads/dev
5021a3be4be18dbdb80f6ce2a01a7ca780862c30        refs/heads/master

我现在的问题是让所有这些都在 smartgit 中工作。

我将其配置为使用系统 ssh。但是在克隆对话框中,在第一个“下一步”按钮之后,它一直挂在 Checking connection to repository 上,而从未询问过我的代理密码。

那么,解决办法是什么?

【问题讨论】:

    标签: windows git ssh proxy


    【解决方案1】:

    所以解决方法很简单。

    第一个解决方案

    需要添加一个包含SSH_ASKPASS的环境变量

    git gui--askpass
    

    现在 smartgit 会询问代理密码。

    唯一剩下的问题是 smartgit 会经常询问密码。

    第二种解决方案

    创建一个dos批处理文件passwd.bat包含

    @echo mypassword
    

    然后回到解决方案一,SSH_ASKPASS 变量现在包含

    path-to-bat-file\passwd.bat
    

    【讨论】:

      猜你喜欢
      • 2016-08-06
      • 2015-10-04
      • 2013-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-10
      • 2012-12-24
      • 2012-10-21
      相关资源
      最近更新 更多