When I am trying to push to my remote git repository, but it is taking forever and nothing happens. I waited for so long, but push is never getting finished. My OS is Ubuntu 12.10. Thank you.
15 Answers
Try using the --verbose option to see what actually happens. 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.
1 Comment
git push --ipv4 <remote> solved it for meI had the same problem. If you are using Bitbucket.org, I don't know why, but disabling IPV6 connection fixed the problem.
5 Comments
/etc/sysctl.conf). If you need ipv6, then force your PC to use bitbucket's ipv4 by adding this to your hosts file: 104.192.143.3 bitbucket.orggit push --ipv4 your-remote git push --ipv6 your-remote Editing the question was unfortunately blocked by "There are too many pending edits on Stack Overflow. Please try again later." ...I have faced a similar issue using git bash. Using these commands helped.
git config --global core.preloadindex true git config --global core.fscache true git config --global gc.auto 256 https://blog.praveen.science/solution-to-git-bash-is-very-slow-in-windows/
1 Comment
git push finished in seconds.Ensure you're using the right protocol.
Depending on how you have your local configurations set up, you might need to use https to connect. To do so, switch the protocol for the remote repository from the [email protected]:[user]/[repo] protocol to the https://github.com/[user]/[repo].git protocol.
Also, it's worth trying vice versa, if you're unable to use the https protocol. On older configurations, the older git@github user authentication will often allow you to connect as a fallback.
2 Comments
Ensure you are authenticated to github: For me, it was my authentication. I was running the command with git bash on windows and for some reason, it didn't prompt me to authenticate. when I ran it with the command prompt, I got this
Select an authentication method for 'https://github.com/': 1. Web browser (default) 2. Personal access token option (enter for default): after I successfully authenticated, it worked fine
Comments
Please check the permission rights on the remote dir. In my case, after setting the correct permissions by chown -R user.group /dir, the commit is correctly finished:
$ git push --verbose Pushing to ssh://[email protected]:port/dir [email protected]'s password: Counting objects: ... ... Total 123 (delta 21), reused 16 (delta 12) To ssh://domain.zone:port/dir * [new branch] master -> master updating local tracking ref 'refs/remotes/origin/master' Comments
One possibility might be that you have large binary file(s) commited in the latest commit. git is not good at working with binary file. If commiting binary files was a mistake, you can refer to following answer for getting rid of binary file in commit.
Comments
Every time I reinstall or upgrade Ubuntu (all 3-4 times), I had to go to the DNS settings of my internet connection (both Ethernet and Wifi), remove Automatic and add 8.8.8.8 and 1.1.1.1. After a reset git push and all other git-origin-accessing commands go down from 1 minute to a few seconds.
Comments
For people cloning repositories and then pushing to a new remote -
If you are starting a new project from a clone, (from the CLI without a fork) when you push to a blank remote you are pushing the entire history of the project you just cloned. This is going to take some time. If you just need the clone as it stands and you don't want the history, delete the .git directory after you clone it, then re-initialize the local repo with git init and push it to your new remote. Should push quickly.
Comments
I had this issue and all I had to do was checkout to a new branch, and use the command: git push origin <new_branch>
I later discovered that the issue was due to me always deleting branches after a merge, and still trying to push locally to those deleted branches. I hope this helps anyone faced with this.
1 Comment
I resolved my problem by rebasing my branch with the develop branch (working in a team). Here is how rebasing works.
Comments
It might be some kind of
Delete every settings file related to the keywords "vcs" and "git" in the app data directories of your IDE (Search "vcs" and "git" in the search bar and delete every file you see in the results):
For example if you use Android Studio:
C:/Users/%USER%/AppData/Local/Google/AndroidStudio%VERSION%
C:/Users/%USER%/AppData/Roaming/Google/AndroidStudio%VERSION%
And then restart your IDE!
1 Comment
I also experienced a similar blocking at git push in my linux shell. For me, the problem seemed to be related to X11 forwarding, as git wanted to ask my password in a dedicated x window (Qt?)... After making sure I could open a "xeyes" window, git push worked directly. Hoping this could give you a hint if above solutions don't work :) Cheers
Comments
The hang after "POST git-receive-pack" often indicates a buffer or packet size problem. Try these Git configuration changes:
git config --global http.postBuffer 524288000 git config --global http.lowSpeedLimit 1000 git config --global http.lowSpeedTime 600 also sometimes GitHub sometimes has issues with HTTP/2. Force HTTP/1.1:
git config --global http.version HTTP/1.1
--verbose? We need more info to help yousshorhttpsremote url? How big is your repository? Is it possible that repository is hundreds of megabytes because of some commit you did recently with a huge binary files?