christianmlong + graft   1

git filter branch - How do I remove the old history from a git repository? - Stack Overflow
echo "<NEW-ROOT-SHA1>" > .git/info/grafts

git filter-branch -- --all

- or -

git checkout --orphan temp deadbeef
git commit -m "Truncated history"
git rebase --onto temp deadbeef master
git branch -D temp

git gc --aggressive --prune=now

That can leave a lot of commits that are referenced by tags and remote branches. So, make another clone

git clone --no-local --no-hardlinks /path/to/old/repo /path/to/new/repo

Do a 'du' on the new clone, to make sure it does not take up as much space as the old repo.
git  remove  history  graft  orphan 
march 2015 by christianmlong

Copy this bookmark: