rtyley / bfg-repo-cleaner

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
https://rtyley.github.io/bfg-repo-cleaner/
GNU General Public License v3.0
10.84k stars 535 forks source link

Error: pack exceeds maximum allowed size #403

Open navidcy opened 3 years ago

navidcy commented 3 years ago

After push I get the following error:

 $ git push
Enumerating objects: 2896, done.
remote: fatal: pack exceeds maximum allowed size
error: remote unpack failed: index-pack abnormal exit
To github.com:FourierFlows/GeophysicalFlowsDocumentation.git
 ! [remote rejected] gh-pages -> gh-pages (failed)

I don't think that this is bfg-repo-cleaner's fault but is there a way around it?

dginovker commented 3 years ago

From what I've read you need to have smaller pushes - which in my case meant a rollback, then making several pushes in smaller chunks.

Wasn't great but it worked!

solvaholic commented 2 years ago

👋 If the branch you're pushing already exists in your clone and in the remote repository, you can have Git step through pushing subsets of the commit history. For example:

remote=origin
branch=main
step=10000
step_commits=$(git rev-list --reverse ${branch} | awk "NR % ${step} == 0")

for commit in ${step_commits} ${branch}; do git push ${remote} ${commit}:${branch}; done
wchi-winker commented 1 year ago

It's useful,thank you.