add and use git cleaning scripts
This commit is contained in:
parent
6764ee4285
commit
370e33c9ba
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
git rev-list --all --objects | \
|
||||||
|
sed -n $(git rev-list --objects --all | \
|
||||||
|
cut -f1 -d' ' | \
|
||||||
|
git cat-file --batch-check | \
|
||||||
|
grep blob | \
|
||||||
|
sort -n -k 3 | \
|
||||||
|
tail -n40 | \
|
||||||
|
while read hash type size; do
|
||||||
|
echo -n "-e s/$hash/$size/p ";
|
||||||
|
done) | \
|
||||||
|
sort -n -k1
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
read files
|
||||||
|
|
||||||
|
git filter-branch -f --index-filter \
|
||||||
|
"git rm --force --cached --ignore-unmatch $files" \
|
||||||
|
-- --all
|
||||||
|
|
||||||
|
rm -Rf .git/refs/original && \
|
||||||
|
git reflog expire --expire=now --all && \
|
||||||
|
git gc --aggressive && \
|
||||||
|
git prune
|
Reference in New Issue