Git freezes when writing objects

I'm trying git push -u origin master and it just hangs on

 Writing objects: 99% (219/220), 12.65 MiB | 97 KiB/s 

Part 12.65 is shifting. When I exit the process and start it again, it resumes at 99%, but never ends, as before.

He never advanced successfully. This is the initial commit.

+76
git
Jul 31 '11 at 2:45
source share
7 answers

This was due to a huge, unregistered file in the repo directory. Oops

EDIT

The hang was due to the fact that downloading the file took a long time. The file should not have been included in the push.

EDIT

Although the cause of this problem may be a large file, if you cannot ignore this file or simply click it, follow this answer.

+31
Jul 31 '11 at 21:33
source share

I followed VonC's advice:

 git config --global http.postBuffer 524288000 



For future links based on comments:

 500 MB: 524288000 (as posted in the original answer) 1 GB: 1048576000 2 GB: 2097152000 (anything higher is rejected as 'out of range') 
+183
Oct. 30 '14 at 20:52
source share

I had the same problem with (write object% 16), stuck, then fatal. I solved this by saving the current changes and cloning a new repository and then copying the changed files into it.

Eg. Suppose the current repository is A, then all you have to do is:

  • mv AB
  • git clone A
  • mv B/* A/
  • rm -rf B

Then lock and click and it all works fine. It recognized the moved files as changed :)

+7
Oct 19 '12 at 22:36
source share

In my case, I used the git folder with bad permissions, which is stored on the same drive as the repository, but it can be the same with ssh, even if you use an authorized user to log in.

Then check if you have the correct write permissions in the remote repo.

Example:

Initiation of local and distant repo

 git init /tmp/src git init --bare /tmp/dst cd /tmp/src 

Adding a remote repo to the source

 src > git remote add dest /tmp/dst 

Imitation problem

 src > chmod -R 555 /tmp/dst 

Adding a fake file and sending it

 src > touch a && git add a && git commit -m 'demo' src > git push --set-upstream dest master src > git push Counting objects: 3, done. Writing objects: 99% (2/3), 202 bytes | 0 bytes/s. 

Bastard hanging

Decision

 src > chmod -R 775 /tmp/dst 
+3
Jun 20 '18 at 16:02
source share

In my case, I had a slow download speed on the Internet, and the file I wanted to click was large, the trick is to use git LFS (large file storage), where it’s much more painful to upload large files, you can find a git LFS tutorial here

+2
Dec 19 '17 at 15:57
source share

git clean -f -n solves my problem. There are many traceless files that are not detected. But be careful, because this will delete the files in your directory.

+1
Aug 23 '16 at 12:05
source share

In my case, I tried to push, not following the rules of my company. Later, I found out that we should start our commit messages with "MOBIL-XXXX", where XXXX is the number that we assigned to Jira (another tool we use to track the development situation).

Make sure your company has a similar restriction rule.

0
Apr 05 '19 at 8:36
source share



All Articles