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?
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.
The default is 1MB.
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.
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.
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.
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
Increase the Git buffer size to the largest individual file size of your repo
git config --global http.postBuffer 157286400
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.
Bypass the outbound proxy as explained on Can't clone or pull due to a git outbound proxy
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With