8

I added two large files to my repository (150MB each) and now git pull always hangs at 54%. I checked the network using ping, tried using a different one, I did a git fsck etc. Nothing helps.

  • How can I debug this?

  • Is there a way to just fetch one of the large files at a time? The problem is that my local git does not know of the last commit =-(

Cœur
  • 37,241
  • 25
  • 195
  • 267
louis cypher
  • 667
  • 1
  • 6
  • 13
  • Might be worth considering usage of [`git-annex`](http://git-annex.branchable.com/) to manage huge files efficiently. See http://stackoverflow.com/a/6635160/429758 for more details. – Prakash Murthy Nov 01 '12 at 12:56
  • Thanks for that! I definitely will go for that. But even after removing the two files from the remote repository I cannot pull. The number of object now is larger. Nevertheless git freezes – louis cypher Nov 01 '12 at 17:21
  • You might try to change memory size limits in your git-config (pack.packSizeLimit core.packedGitLimit for instance) – Zermingore Oct 16 '17 at 08:23
  • Try running `git pull -v` and see if you get anything in logs – Tarun Lalwani Oct 16 '17 at 19:44
  • Please provide more context, etc. - Where is the remote, and how did you add those files? What system is the remote running on (if Github, Gitlab, etc.)? Can you post the error output when it hangs? Etc. **Also**, did you try pulling down from an alternate PC or on a separate (clean) local repo? – LightCC Oct 16 '17 at 22:30
  • 1
    What's the output of `strace git pull <...>`? If you are on Linux you probably have this command and on Windows it's available in the Bash shell of Git for Windows. – Samir Aguiar Oct 18 '17 at 15:16
  • I'd also be curious to know how `git gc` affects this. – Dan Oct 21 '17 at 15:12

3 Answers3

1

But even after removing the two files from the remote repository I cannot pull.

What means did you use to "remove the two files" ?

You would need to remove them from all commits in the history of your repository.

To do this, see for example : How to remove/delete a large file from commit history in Git repository?


To check if your git pull is really stalled or just very slow : check the network traffic between your compouter and the server which hosts the central repo.


If you have another way to get the 2 big files (e.g : copy them into your local repository from a usb stick ...) you can run git add (do not run git commit) on these files from your local repository, and then git reset . to unstage them.

This should add these files in the list of known objects in your local repo, and git pull should not need to download them again.

LeGEC
  • 46,477
  • 5
  • 57
  • 104
0

I think the problem you are having is your clone breaks off in the middle every time.

So, instead of cloning a repo again and again from scratch everytime, I would suggest you instead do a fetch on a freshly created repo.

Basically, initialize an empty repository

cd repo_name && git init

Add the original repo as a remote in this repo

git remote add origin url/to/repo

And now do a git fetch.

This way, even if your clone breaks in the middle, fetch will take care to bring in unfetched objects only in next run.

0

Increase the Git buffer size:

git config --global http.postBuffer 157286400

The size should be set to the minimum that solves the issue.

yorammi
  • 6,272
  • 1
  • 28
  • 34