与github同步

时间:2011-03-21 12:41:46

标签: github

这是我第n次尝试连接到我的github帐户,并且在我未能做到这一点时变得越来越令人沮丧。

我一步一步地遵循本教程Github setup on windows,但我在第5步失败了,即测试一切。

ssh git@github.com

给了我这个

ssh: github.com: no address associated with name

任何想法有什么不对?任何帮助将不胜感激。

我正在使用Windows XP上的railsinstaller附带的默认git安装(代理后面)

4 个答案:

答案 0 :(得分:18)

您至少需要设置一个HTTP_PROXY变量环境。

set HTTPS_PROXY=http://<login_internet>:<password_internet>@aproxy:aport
set HTTP_PROXY=http://<login_internet>:<password_internet>@aproxy:aport

或者,对于bash会话:

 export http_proxy=http://<login_internet>:<password_internet>@aproxy:aport
 export https_proxy=http://<login_internet>:<password_internet>@aproxy:aport

确保将%HOME%(或$ HOME)设置为存储.ssh配置

的目录

然后,对于git命令:

git config --system http.sslcainfo \\bin\\curl-ca-bundle.crt
git config --global http.proxy http://<login_internet>:<password_internet>@aproxy:aport
git config --global user.name <short_username>
git config --global user.email <email>
git config --global github.user <github_username>
git config --global github.token <github_token>

注意:对于bash会话:

git config --system http.sslcainfo /bin/curl-ca-bundle.crt

要避免GitHub要求您输入密码,请在_netrc(或HOME bash会话)中创建.netrc文件

machine github.com
login <login_github>
password <password_github>

2012年更新

请注意since git1.7.10(2012),您可以使用credential caching mechanism,以避免以明文形式存储您的登录名/密码(在%HOME%/_netrc文件中)。

答案 1 :(得分:1)

对于那些没有启用代理并且问题仍然存在的人,我找到了解决方案!这是约塞米蒂的一个问题。 Apple通过发现取代了mDNSResponder。这是一项服务,您可以卸载并加载它:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist

这篇文章解释了每一个细节:

http://arstechnica.com/apple/2015/01/why-dns-in-os-x-10-10-is-broken-and-what-you-can-do-to-fix-it/

它对我有用!

答案 2 :(得分:0)

如果你是代理人,你是否也在防火墙后面?请尝试运行ssh -v git@github.com以查看幕后发生的情况。对于我的设置,我的~/.ssh/config看起来像这样:

Host github.com
ProxyCommand /c/windows/connect.exe -H name_of_proxy:8080 %h %p
User git
Port 443
Hostname ssh.github.com
TCPKeepAlive yes
IdentitiesOnly yes

ProxyCommand描述为here

答案 3 :(得分:0)

好像您可能没有正确配置SSH配置。 github.com无法解决的原因是因为您可能指向不能解析域外查询的DNS服务器。

我写了一篇关于此的博文,请看一下: http://returnbooleantrue.blogspot.com/2009/06/using-github-through-draconian-proxies.html

希望这有帮助。

相关问题