Reputation: 4691
I tried to publish a file which was over 100MB
I then looked it up and realised GitHub has a limit.
Whilst it looks like I can make changes to use larger file Git lfs - "this exceeds GitHub's file size limit of 100.00 MB" that's not my goal. Instead, I edited the file and it's now under around 80MB
The issue is, when I try to git pull
(or sync using the web application) I still get told this file is too big...
I can only guess git has got a handle to something which no longer exists but I have no idea how to remove it from attempted to upload this file.
This is my effort which also shows the failure (the first line). This is copied from the Git Shell
remote: error: File Photoshop/Originals/homePage.psd is 119.97 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/company/site.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/company/site.git'
G:\websites\GitHub\site\Website\site[master ↑3 +0 ~1 -0 !]> git rm --cached Photoshop/Originals/homePage.psd
fatal: pathspec 'Photoshop/Originals/homePage.psd' did not match any files
G:\websites\GitHub\site\Website\site [master ↑3 +0 ~1 -0 !]> git rm Photoshop/Originals/homePage.psd
fatal: pathspec 'Photoshop/Originals/homePage.psd' did not match any files
G:\websites\GitHub\site\Website\site [master ↑3 +0 ~1 -0 !]>
Upvotes: 0
Views: 1872
Reputation: 1323075
Try and use BFG Repo-Cleaner, but make sure your current working tree has no change in progress (add and commit first)
cd /path/to/your/local/repo
java -jar bfg.jar --strip-blobs-bigger-than 100M some-big-repo.git
git reflog expire --expire=now --all && git gc --prune=now --aggressive
Then push the new history (force push to overwrite: make sure you are the only one working on that repo, or do communicate your rewrite)
git push --force
Upvotes: 1