Git: how to completely delete commit before a specified one? -


after years of git commits, we'd delete old ones.

we have commit number want consider new 'base'.

how can ask git remove all(and remove) commits before specified one?

create temporary branch commit , rebase against it:

git checkout --orphan temp commitid git commit -m "truncated history" git rebase --onto temp commitid master git branch -d temp 

where commitid new base. check the article details.


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -