Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git push hangs after Total line

Tags:

git

bitbucket

My git push is hanging after appearing to complete the push. I am going git push

Counting objects: 51, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (47/47), done.
Writing objects: 100% (47/47), 27.64 MiB | 6.47 MiB/s, done.
Total 47 (delta 4), reused 0 (delta 0)

It hangs here and I have to control-c to get back to command line. I have made several commits in the past with this project with no issues. I have tried other repos on my machine and they work fine. What is going on here?

like image 964
Patrick Avatar asked Apr 05 '13 21:04

Patrick


People also ask

Why is my git push 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.

What is git buffer size?

The default is 1MB.

What is the push command in git?

The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo. It's the counterpart to git fetch , but whereas fetching imports commits to local branches, pushing exports commits to remote branches.

What is git push origin?

Git Push Origin pushes all the branches to the main branch. Git Push Origin Master pushes your master branch to the origin. Command for this: git push origin.


4 Answers

This turned out to be no problem at all. I simply had to wait until the upload was complete. I had added several large files and there is not a progress indicator. Maybe someone else will find this helpful.

like image 129
Patrick Avatar answered Oct 15 '22 05:10

Patrick


https://git-scm.com/docs/git-config#Documentation/git-config.txt-httppostBuffer

http.postBuffer

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.

Note that raising this limit is only effective for disabling chunked transfer encoding and therefore should be used only where the remote server or a proxy only supports HTTP/1.0 or is noncompliant with the HTTP standard. Raising this is not, in general, an effective solution for most push problems, but can increase memory consumption significantly since the entire buffer is allocated even for small pushes.

Resolution

  1. Increase the Git buffer size to the largest individual file size of your repo

  2. git config --global http.postBuffer 157286400

  3. Refer to the resolution of Git push fails - client intended to send too large chunked body for ngnix reverse proxy configuration. Increase this parameter to the largest individual file size of your repo.

  4. Bypass the outbound proxy as explained on Can't clone or pull due to a git outbound proxy

like image 29
Faiz Ahmad Dae Avatar answered Oct 15 '22 06:10

Faiz Ahmad Dae


Try:

git gc

I had it hang at the same spot but with very small files, so waiting was not the answer. The solution was a git gc (garbage collection) to recalculate the deltas in the repo.

like image 18
Mat Avatar answered Oct 15 '22 07:10

Mat


It only worked for me in the case when I did git push -u origin main, when I just simply used git push for bit bucket, it did not push through.

like image 16
pal4life Avatar answered Oct 15 '22 05:10

pal4life