Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 813
Matt Singer Avatar asked Jun 03 '13 21:06

Matt Singer


People also ask

Why is git push taking so long?

Even if you did small changes, some internal things might cause git to push a lot more data. Have a look at git gc. It cleans up your local repository and might speed up things, depending on you issue. Backup strongly advised.

Why my git push is not working?

If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.

Why is Github rejecting my push?

A commit gets rejected and causes a failed to push some refs to error because the remote branch contains code that you do not have locally. What this means is that your local git repository is not compatible with the remote origin. Based on the above, your local machine is missing commits C and D.

Why can't I push code to Github?

To push a branch on remote, your branch needs to have the latest changes present in remote repository. If you get the failed to push error, first do git pull the branch to get the latest commits and then push it.


2 Answers

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.

like image 110
forloop Avatar answered Sep 24 '22 17:09

forloop


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.

like image 37
Matt Montag Avatar answered Sep 22 '22 17:09

Matt Montag