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

java - Static nested class instance -

Python Pandas join aggregated tables -

process - Python What is the difference between a Pool of worker processes and just running multiple Processes? -