Ticket #51158: git-kill-history

File git-kill-history, 379 bytes (added by RJVB (René Bertin), 8 years ago)
Line 
1#!/bin/sh
2
3git checkout master
4branches="`git branch | sed 's/..//'`"
5for branch in ${branches} ;do
6        echo git checkout $branch
7        git checkout $branch
8        for new_root in "${@:-HEAD}"; do
9                new_root_hash=`git log -n1 --format=%H "$new_root"`
10                echo "$new_root_hash"
11        done >.git/info/grafts
12        git filter-branch -f
13done
14rm .git/info/grafts
15`dirname $0`/git-gc-all-ferocious --aggressive