How to squash all commits related to a specific file or folder? I can probably collect the hashes in a first step, and then pipe them as input to a second command.
It would also be acceptable to modify commits in order to remove the parts related to specific files or folders, with all recent changes there being committed by a new, single commit.
To make the use case clearer, let us say that i want to eliminate the history related to specific files
You may want to use git filter-branch, like this :
git filter-branch --tree-filter 'rm -rf FOLDERNAME' HEAD
More info here : http://git-scm.com/docs/git-filter-branch
Be really careful with this command, this it's rewriting the entire history. Be sure to have a backup copy of your repository somewhere.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With