3

A few days ago, without intentionally changing anything, my git stopped working.

I can run git status and git diff which work fine, and I can ssh into our git server, but if I run any of git pull|push|fetch|clone, it just hangs and does nothing. My internet connection is fine and I've left it to run for ~1.5 hours trying to clone a very small repo. There's no output at all, it just does nothing.

No one else is having issues with their git, so I'm quite confused.

Any help would be much appreciated.

Edits

Local: git version 1.8.3.2

git remote -v: shows 2 sets of 2 git repo locations (origin and upstream for fetch/push). All of this form: origin|upstream git@foo.bar.com:repo_path.git (fetch|push)

Local platform: Linux (Ubuntu 13.10)

ssh -T git@foo.bar.com takes a while and then results in: Welcome, [user]. Use git to push/pull your repositories

Running this: [user]@computer:~/work/git/repo$ GIT_CURL_VERBOSE=1 GIT_TRACE=1 git fetch results in this:

trace: built-in: git 'fetch'
trace: run_command: 'ssh' 'user@git.foo.com' 'git-upload-pack '\''/home/git/repo/'\'''
[waits seemingly indefinitely]

but if I run ssh user@git.foo.com, I get into the server.

Mike T
  • 4,747
  • 4
  • 32
  • 52
  • What git version are you using locally? on the server? Are you on windows or Linux or Mac locally? What does `git remote -v` returns? Are those https or ssh urls? – VonC Jul 21 '14 at 10:58
  • DOes `ssh -T git@foo.bar.com` works? – VonC Jul 21 '14 at 11:12

2 Answers2

2

I very recently got a new router. I switched back to the old router after seeing this SO post: git clone hangs forever on github

Everything works again.

"This is why we can't have nice things" - me to my new router.

What I'm still confused about is how my router managed to break stuff in such a way that I could still SSH in my work server and clone from github but not clone from our work server.

Community
  • 1
  • 1
Mike T
  • 4,747
  • 4
  • 32
  • 52
0

If I remember correctly, git status and git diff work offline so that's not meaningful. The fact you can manually connect via SSH is important - that gives confidence that remote server is OK and that there are no DNS/etc problems.

I don't see git "just hanging" very often, but one case see that behaviour is on Windows with Git-UI (not via console!), when GIT is trying to ask you for password from a background job, while not having core.askpass set correctly. Quite common on Windows machines, when working with Git-Extensions and working in mixed GUI/Bash environment with HTTPS or SSH servers. On console it works properly, but GUI might hangs on any connection attempt.

If that sounds somewhat similar to your setup, check:

  • Does your SSH ask for any logins/passwords during connection?
  • Did your GIT client ask for them earlier? Does it now?
  • Did you use any credentials-agent with GIT? Is it running in the background, etc?

I don't know how it really works inside, but I can imagine a case when you configured Git to use i.e. pageant on installation, not configured core.askpass, used Git-GUI all the time and it worked and now your pageant died for some reason and Git tries to ask for password and hangs because core.askpass is not set..

It's pure guesswork, but even if completely missed - it's still worth to check the above points and write them down so maybe others will notice something odd.

quetzalcoatl
  • 32,194
  • 8
  • 68
  • 107