问题
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 now issues. I have tried other repos on my machine and they work fine. What is going on here?
回答1:
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.
回答2:
It can be (as the accepted answer suggests) just a moment to wait, but in the majority of cases it is linked to permissions on the remote. While mostly a non-issue on public git services such as GitHub, Gitlab or Bitbucket, self-hosted remotes might have a special user, or a group for access.
And on new bare repositories it doesn't suffice to change the folder,
but instead needs to be recursive because of .git
-Folder inside.
回答3:
Permissions can also be cause of this in the case of a bare repo on a remote machine.
回答4:
It only worked for me in the case when I did
git push -u origin master
, when I just simply used git push
for bit bucket, it did not push through.
回答5:
Waiting until the upload finished doesn't work for me. I pushed not very big file, but waited long enough, still hanged.
What helped for me is updating from msysgit 1.9.5
to git-for-windows 2.6.2
.
回答6:
Just wanted to add this in case it helps anyone. I had the same problem, and the issue was that the git user didn't have permission to write to the files, only to read from them.
回答7:
The problem is that the upload file is big.
Either you wait it out or go to your project folder and delete all the libraries which you could find in the target folder if using maven. Then do the push and it will happen quickly.
Anyways, the library folders need not be stored in git, it's just a waste of git space unless and until they are not available in the maven repositories and you really need to store them
回答8:
See if you have staged, but not committed changes. (git status
)
If so, commit (or unstage) those and then try to push. Worked for me.
回答9:
In my case it was caused by a problem with msysgit 1.9.5
. Downgrading to msysgit 1.9.4
solved the problem.
回答10:
In my case, the remote had a full disk. Removing some files on the remote promptly fixed the issue.
回答11:
Checkout the user rights that git is using!
In my case I tried through ssh and the used system user was unable to write into the git bare repository...
Here is how you can debug your ssh connection
回答12:
This issue can be caused by issues with your SSH agent.
I recently ran into this issue because I changed my default shell from zsh
to bash
. I'd originally set up my ssh keys using zsh
, and so they were not available by default to bash
, using chsh -s /bin/bash
.
To fix, you'll need to add your ssh key(s) to the SSH authentication agent using the same shell script (bash
, sh
, zsh
, etc) you're using to perform your git commands:
eval `ssh-agent`
ssh-add ~/.ssh/some_key_rsa
You'll need to enter the passphrase for the key in order to add it. To store the passphrase to your user keychain so you don't need to enter it every time the key is used, add the key with the -K
option to the ssh-add
command.
ssh-add -K ~/.ssh/some_key_rsa
Note the uppercase K
as using a lowercase is a different command option.
回答13:
I ran into this same problem while pushing to GitHub. I found that a subset of the files being pushed wasn't being accepted.
I found this out by breaking my large commit into smaller commits (as described in this SO question: Break a previous commit into multiple commits), and then finding success with most of the smaller pieces.
The problem piece contains image files and I'm still sorting out which particular file (or files) triggers the problem.
来源:https://stackoverflow.com/questions/15843937/git-push-hangs-after-total-line