在 Windows 中使用 git 的新手。我下载了 GitHub Desktop 应用程序并且可以连接我的帐户,但是由于未解析的主机,执行推/拉失败。在工作场所四处询问时,我得到了以下建议,将这个命令输入到 git shell 中。
git config --global http.proxy http://username:password@proxy.workplace.com:8080
做这个:
GitHub for Desktop 不生成并使用 SSH key 吗(我第一次连接帐户时收到电子邮件通知)?如何配置 GitHub Desktop 以使用此代理?
最佳答案
在不使用 git shell 的情况下直接向 Github Desktop 添加代理:
C:\Users\@yourusername
. [http]
proxy = http://username:password@your.proxy.address:8080
并保存。
注意(对于 TFS 用户):当您使用上述代理配置时,TFS 将返回 502 bad gateway 错误。使用 hash # 注释掉 .gitconfig 中的代理配置以在 Git 和 TFS 之间切换。
关于proxy - 如何配置 GitHub Desktop/Windows 以使用代理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38615168/