15

This is for the nth time that I'm trying to connect to my github account and its becoming increasingly frustrating at my failure to do this.

I followed this tutorial step by step Github setup on windows but I failed at step 5, i.e. Test everything out.

ssh git@github.com

gives me this

ssh: github.com: no address associated with name

Any ideas what is wrong? Any help would be greatly appreciated.

I'm using the default git installation which comes with railsinstaller on Windows XP (behind a proxy)

Prakhar
  • 3,486
  • 17
  • 44
  • 61

4 Answers4

20

You need to at least set an HTTP_PROXY variable environment.

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

Or, for bash session:

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

Make sure %HOME% (or $HOME) is set to a directory where you did store your .ssh config

Then, for git commands:

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>

Note: for bash session:

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

To avoid GitHub asking for your password, create a _netrc file in your HOME (or a .netrc for bash session)

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

Update 2012

Note that since git1.7.10 (2012), you can use a credential caching mechanism in order to avoid having to store in plain text your login/password (in a %HOME%/_netrc file).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    If your having an error about \\bin \\ curl-ca-bundle.crt, you can use: git config --global http.sslverify "false" – DarkteK Jul 20 '16 at 18:51
  • @GonzaloJarjury That would not be a practice I would recommend. Always try to verify your certificates. Try first, even on Windows with recent version of Git: `git config --system http.sslcainfo /ssl/certs/ca-bundle.crt` – VonC Jul 20 '16 at 18:54
  • 1
    Is `````` the WiFi name? – Jessica Jun 11 '19 at 14:56
  • 1
    @McFloofenbork 8 years later, I believe the "login_internet" represents your login account you would use to authenticate to the proxy. – VonC Jun 11 '19 at 15:03
  • what are the and ? – Sara May 10 '20 at 20:29
  • @Sara Same: an enterprise proxy needs the credentials of your current Windows or Mac session: your login and password for your current OS session. – VonC May 10 '20 at 22:10
1

For those who don't have a proxy enabled and the problem persists, I found the solution! It's a problem with Yosemite. Apple replaced the mDNSResponder by the discoveryd. It's a service and you can unload and load it back:

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

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

This post explains every detail:

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

It worked for me!

Elvio Cavalcante
  • 476
  • 5
  • 10
0

If you are behind a proxy, are you also behind a firewall? Please try to run ssh -v git@github.com to see what's going on behind the scenes. For my setup, my ~/.ssh/config looks like this:

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

The ProxyCommand is described here.

jhwist
  • 15,201
  • 3
  • 40
  • 47
  • Yes, I'm behind a firewall. However, the proxy i'm using is a script and not a static address. How can I take that into account in the config file? – Prakhar Mar 21 '11 at 13:10
0

It seems like you might not have configured your SSH config properly. The reason github.com is unresolvable is because you are probably pointed to a DNS server that doesn't resolve queries outside your domain.

I wrote a whole blog post about this so take a look here: http://returnbooleantrue.blogspot.com/2009/06/using-github-through-draconian-proxies.html

Hope this helps.

Jeff T
  • 620
  • 8
  • 12