[git] 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

This question is related to git github cygwin freeze git-push

The answer is


Will usually see myself running into this problem when pushing a large quantity of files.

If you can be patient and let the files finishing uploading, you might not need to do anything at all. Good luck –


Try the following;

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

This will prompt for credentials and then "push" succeeds if credentials are correct.


  1. Had the same problem. Was a little bit confused but the thing was I had make a git init --bare on root, that means that you won't be able to push because of you don't have any rights. Instead make a new User or in my case I used Pi User and made git init --bare there, which then later on it worked.

  2. git config --global http.postBuffer 524288000

Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.


I had the same problem with absolutely same symptoms… I was about to rebuild my whole system in my despair)).

I even was so naive to try git config --global core.askpass "git-gui--askpass" as some people suggest here, but it didn't work… git push was still freeze…

But then I figured out that there was an error with my SSH agent. So I've restarted ssh-agent and… PROFIT

Conclusion: Always check your SSH Agent and SSHD server when you have troubles with ssh connection… I'm pretty sure that was your problem (And that's why it worked after reinstallation of your system)


I had the same issue. Stop worrying and searching endless complicated solutions, just remove git and reinstall it.

sudo apt-get purge git
sudo apt-get autoremove
sudo apt-get install git

Thats it. It should work now


This occurred for me when my computer's disk space was full. Delete some files & empty the trash to fix.


I'm wondering if it's the same thing I had...

  1. Go into Putty
  2. Click on "Default Settings" in the Saved Sessions. Click Load
  3. Go to Connection -> SSH -> Bugs
  4. Set "Chokes on PuTTY's SSH-2 'winadj' requests" to On (instead of Auto)
  5. Go Back to Session in the treeview (top of the list)
  6. Click on "Default Settings" in the Saved Sessions box. Click Save.

This (almost verbatim) comes from :

https://tortoisegit.org/issue/1880


I had the same problem. All the git commands accessing remote git repository are hanging. I forgot that I changed my VM network settings. Once I changed it back to NAT (as before) then they started working. It is not an issue with the git but with the network itself.


For the sake of completeness (sometimes problems like this are not as complicated as they might seem):

Having a non-existing remote repository configured can also result in this behavior - I recently found out by accidentally changing my origin's URL to githu.com.


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.


In my case the issue was there was some process that had locked my keychain access...

Force quit all other apps to make sure keychain access is not locked on your Mac


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.


Restart your ssh agent!

killall ssh-agent; eval `ssh-agent`

Another reason might be that the git server has reached its resource limits, and there's nothing wrong with your local git setup.


This occurred for me, here is how I fixed. I used Cygwin and it hanged so I tried prompting for username/password on commit :

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

Once I executed git push -u origin master and entered username password, it still did hang but appeared to commit to GitHub.

Used same command from dos prompt : git push -u origin master Git does not hang. So perhaps issue related to CygWin in my case.


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.


I thought my Git windows screen was struck but actually a sign in prompt comes behind it.Check for it and enter your credentials and that's it.


I just wanted to say that I'm having this issue on my AWS EC2 instances. I was trying to push from my EC2 instance itself, when I have it configured to only allow traffic in from the load balancer. I changed the rule to allow HTTP in from everywhere, but it still didn't fix the problem. Then I realized it's because my security groups are configured to not allow outbound traffic from my EC2 instances over HTTPS. I didn't have allow HTTPS inbound traffic to make it work, even though it's probably a good policy for you to have HTTPS available inbound.


I also had an issue where git hangs on the "Writing objects" part on Windows 7 (using msysgit, the default windows client from git) and this is the first hit I got in google, so I will also post my answer here.

git config --global core.askpass "git-gui--askpass" did not work unfotunately, but after some researching I found the tip on Git push halts on "Writing Objects: 100%" to use git config –global sendpack.sideband false which worked perfectly.

I can finally push from the commandline again!


I had two repositories, pushing to one of which worked fine. So, I compared their .git/config. The non-working one had at the end:

[http]
    sslVerify = false

The working one had instead:

[credential]
    helper = store

Changing .git/config solved the problem.


Its worth checking if you are using the cygwin git or an external git (ie github).

If whereis git returns just /cygdrive/c/Program Files (x86)/Git/cmd/git.exe or similar its best to install the cygwin git package, this solved the problem for me.


Examples related to git

Does the target directory for a git clone have to match the repo name? Git fatal: protocol 'https' is not supported Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) git clone: Authentication failed for <URL> destination path already exists and is not an empty directory SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 GitLab remote: HTTP Basic: Access denied and fatal Authentication How can I switch to another branch in git? VS 2017 Git Local Commit DB.lock error on every commit How to remove an unpushed outgoing commit in Visual Studio?

Examples related to github

Does the target directory for a git clone have to match the repo name? Issue in installing php7.2-mcrypt How can I switch to another branch in git? How to draw checkbox or tick mark in GitHub Markdown table? How to add a new project to Github using VS Code git clone error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 How to add empty spaces into MD markdown readme on GitHub? key_load_public: invalid format git - remote add origin vs remote set-url origin Cloning specific branch

Examples related to cygwin

How to install MinGW-w64 and MSYS2? Split text file into smaller multiple text file using command line fatal: early EOF fatal: index-pack failed Git Extensions: Win32 error 487: Couldn't reserve space for cygwin's heap, Win32 error 0 How to cd into a directory with space in the name? Git push hangs when pushing to Github? Running a shell script through Cygwin on Windows Running Git through Cygwin from Windows .ssh directory not being created Cygwin - Makefile-error: recipe for target `main.o' failed

Examples related to freeze

Git push hangs when pushing to Github? Xcode stuck on Indexing

Examples related to git-push

Fix GitLab error: "you are not allowed to push code to protected branches on this project"? ! [rejected] master -> master (fetch first) Git - What is the difference between push.default "matching" and "simple" error: src refspec master does not match any Issue pushing new code in Github Can't push to GitHub because of large file which I already deleted Changing the Git remote 'push to' default What does '--set-upstream' do? Git push hangs when pushing to Github? fatal: 'origin' does not appear to be a git repository