Hello to the community!
As you can see in the diagram there is a commit (cm1) that includes a lot of binary files that was committed in a local branch. This commit was reverted at cm2 and at the final commit (cm4) a Pull Request was created and merged with the commit method 6 months ago. This means that master branch will include the history of this development branch.
The result of this is to be unable to clone the repository due to this commit, so I have to rewrite the history.
I have tried the above command, but somehow it make changes like removing or keeping the next PRs. It is like messing up the commits.
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch make/*' <hash_cm1>..HEAD
An other idea that I thought, and here I would like your contribution, is if I can change the history of this merge and from merge commit method to convert it to merge squash method. Which means to squash cm1,cm2,cm3,cm4 in order to get rid of the existance of binaries from cm1 and have one commit for this PR.
Thank you in advance!
I found the solution to my problem.
The easiest and quicker solution is using tool bfg-repo-cleaner.
Mind to take a repository backup first with
git clone --mirror
For now I see that there is no corruption and worked very well.
Amazing tool!
[EDIT] Seems that only master has changed, and the rest branches contain the binary files...