control-freak-ide/scripts/git/git-kill-history.sh
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

15 lines
396 B
Bash

#!/bin/sh -e
for branch in `git branch | sed 's/..//'`; do
echo git checkout $branch
git checkout $branch
echo "old HEAD: `git-hash`"
for new_root in "${@:-HEAD}"; do
new_root_hash=`git log -n1 --format=%H "$new_root"`
echo "$new_root_hash"
done >.git/info/grafts
git filter-branch -f
echo "new HEAD: `git-hash`"
done
rm .git/info/grafts
confirm git-gc-all-ferocious $AGGRESSIVE # --aggressive