How to truncate Git history
The general idea #!/bin/bash # Parameter: tag or sha1 git checkout --orphan temp $1 git commit -m "Truncated history" git rebase --onto temp $1 master git branch -D temp Requires Git 1.8+
Works well for mostly linear history (aka Git used for diff-ing of the catalog feeds).
How it works Starting repo (training):
➜ test git:(master) git last fe4e396 2015-07-13 | Fix for BuildInfo in TDD, database connectivity works (HEAD, origin/dynamovies/main, master) [Miro Adamy] f1b8636 2015-07-13 | Tables and database creation [Miro Adamy] d4c182b 2015-07-13 | Added template of dynamovies module - with empty UI.