bashbunni / habit-tracker

See your consistency with sticking to your new habits with a heatmap!
44 stars 10 forks source link

Build objects are not in .gitignore #8

Open taigrr opened 2 years ago

taigrr commented 2 years ago

This repo is >20Mb.

Running the following one-liner:

git rev-list --objects --all |   git cat-file --batch-check='%(objecttype) %(objectname)
%(objectsize) %(rest)' |   sed -n 's/^blob //p' |   sort --numeric-sort --key=2 |   cut -c 1-12,41- |   $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest

(sourced from here)

reveals the following:

19a4e8d6ed35  7.4MiB build/habit_tracker
f0d2fe63587e  7.4MiB build/habit_tracker
85dcf8419d1d  7.4MiB build/habit_tracker
ced616388a48  7.4MiB build/habit_tracker
a932a4699a5d  7.4MiB build/habit_tracker
016de987d688  7.8MiB build/habit_tracker
152782609db1  7.8MiB build/habit_tracker
196a936d50d4  7.8MiB build/habit_tracker
f5aef5127fca  7.8MiB build/habit_tracker
e787225d2a1a  7.8MiB build/habit_tracker

Force-pushing to a public repo is not usually a good idea, but to reduce the size I would recommend it in this scenario.

git checkout dev
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --tree-filter 'rm -f build/habit_tracker' HEAD
rm -rf .git/refs/original/
git checkout feature/form-validation
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --tree-filter 'rm -f build/habit_tracker' HEAD
git gc
git push --force
echo build/ >> .gitignore

You can see the results of the filter-branch over at my fork.

This results in a 33% size reduction for the repo as a whole.

bashbunni commented 2 years ago

Ah thank you so much! I'll make those changes now

bashbunni commented 2 years ago

Created a PR to resolve this issue and test the functionality before pushing to dev