housekeeping: Remove large files from git history
See original GitHub issue- image files
- pdf files
set -xe
REPO_URL=https://github.com/intel/dffml
BRANCH=$BRANCH
TEMPDIR=$(mktemp -d)
GIT_FILTER_REPO_PATHS=$(mktemp)
rm -rf $TEMPDIR
mkdir $TEMPDIR
cd $TEMPDIR
git init
git remote add origin $REPO_URL
git fetch origin $BRANCH
git reset --hard origin/$BRANCH
git log -n 3 --oneline
git log --stat $BRANCH | grep -E '\.png|\.jpeg|\.jpg|\.gif'
cat > $GIT_FILTER_REPO_PATHS <<'EOF'
glob:*.gif
glob:*.png
glob:*.jpg
glob:*.jpeg
EOF
git filter-repo --force --invert-paths --paths-from-file $GIT_FILTER_REPO_PATHS
git diff --stat origin/$BRANCH
git log --stat $BRANCH | grep -E '\.png|\.jpeg|\.jpg|\.gif'
git branch
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Reduce repository size - GitLab Docs
To remove large files from tagged releases, force push your changes to all tags on GitLab: git push origin --force 'refs/tags/*'.
Read more >Remove a Large File from Commit History in Git - Baeldung
In this tutorial, we'll learn how to remove large files from the commit history of a git repository using various tools.
Read more >Cleaning up git history - Stack Overflow
Linked. -1 · Remove huge pushed data from git repo history · 78 · Completely remove files from Git repo and remote on...
Read more >Tutorial: Removing Large Files from Git | by Erin Hoffman
Interactive Rebase for Removing Large Files. Conceptually what we're doing here is looking back through the Git history, finding the commit ...
Read more >How can I remove a large file from my commit history?
If you've committed a large file to your repository that takes up a large amount of disk space, simply removing it in a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The repo is still way to big for some reason.
While diffing manifest-main and manifest