Showing posts with label filter-branch. Show all posts
Showing posts with label filter-branch. Show all posts

9/01/2022

Delete 100mb file in all committed history in git

 Let's say the problem which is more than 100mb file is "shit.pt"

And you want to delete already committed in git history and you don't push and reverting.

Then this is save you


> git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch SHIT.bin' --prune-empty --tag-name-filter cat -- --all


Change SHIT.bin file name as your problem guy. 

And add .gitignore and commit & push.

Thank you.

www.marearts.com



1/12/2022

git : How to remove a big file wrongly committed



error message:

remote: Resolving deltas: 100% (23/23), completed with 8 local objects.
remote: error: Trace: 2ffe6017a58c483deb760c27365127df2f67946ddad23f7e84f265b42c275992
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File xxxx.ckpt is 206.67 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.


solution

git filter-branch --tree-filter 'rm -rf path/to/your/file' HEAD
git push