Git push hangs when pushing to Github?

Git push hangs everytime I try to push to github. I am using Cygwin and Windows 7. Git functions fine locally tracking branches, providing status, setting global user.name and user.email and allowing commits.

I'm still new and learning.

I enter git push , git push origin master or git push -u origin master and I get nothing but a blank line requiring me to ctl-c to get the prompt back.

ssh-keygen -t rsa -C "[email protected]" asks me for a file name and hangs

git push heroku master hangs

$ git status returns On branch master nothing to commit, working directory clean

$ git pull returns Already up to date

$ git remote -v returns:

heroku  [email protected]:myherokusite.git (fetch)

heroku  [email protected]:myherokusite.git (push) origin  

https://github.com/gitusername/appname.git (fetch) origin  

https://github.com/gitusername/appname.git (push)

or the correct ssh remote settings are returned when trying this with ssh

Updated: Using the SSH url [email protected]:gitusername/gitrepo.git also hangs

git remote set-url origin https://github.com/gitusername/appname.git is correct

Updated: I can see the git processes running in Windows Task Manager while it hangs.

I've tried:

Using different internet connection locations

switching between https and ssh and it hangs

Uninstalled git. Reinstalled from: https://code.google.com/p/msysgit/downloads/list

Uninstalled git. Installed Cygwin's git

Uninstalled git. Installed Github for Windows GUI app and it I WAS able to push. But this app has limited functionality, forces me out of my Cygwin window into another app which then forces me into a Windows command prompt for complete functionality which I thought I had escaped by using Cygwin.

Spent many, many hours trying to resolve this, it worked faultlessly before, thanks.

UPDATE 4/2014: I rebuilt my entire machine Win 7, Cygwin etc and all is now working fine


Solution 1:

git config --global core.askpass "git-gui--askpass"

This worked for me. It may take 3-5 secs for the prompt to appear just enter your login credentials and you are good to go.

Solution 2:

Try creating a script like ~/sshv.sh that will show you what ssh is up to:

#!/bin/bash
ssh -vvv "$@"

Allow execution of the ~/sshv.sh file for the owner of the file:

chmod u+x ~/sshv.sh

Then invoke your git push with:

GIT_SSH=~/sshv.sh git push ...

In my case, this helped me figure out that I was using ssh shared connections that needed to be closed, so I killed those ssh processes and it started working.

Solution 3:

Try GIT_CURL_VERBOSE=1 git push

...Your problem may occur due to proxy settings, for instance if git is trying to reach github.com via a proxy server and the proxy is not responding.

With GIT_CURL_VERBOSE=1 it will show the target IP address and some information. You can compare this IP address with the output of the command: host www.github.com. If these IPs are different then you can set https_proxy="" and try again.

Solution 4:

Restart your ssh agent!

killall ssh-agent; eval `ssh-agent`