I have a repository with around 3000 commits where i want to squash around 250 of them in the middle of history between two dates like this:
a--b--c--d--e--f--g--h--i--j--k--l--m--n
a--b--c--d'-------------------k--l--m--n
I already know the dates and shas of d and j. What is the best practice to do this?
You can also try a different approach which is kind of similar to the merge approach.
Note: Assuming
nto be the latest andabe the oldest commit.Create a new branch with commit
kas head.Then, soft reset the head to the parent of commit
d.Commit the changes, as all the changes from commit
dtokare not present in the staging area. (git statusto verify)Merge the commits post
k,