How can I remove a folder from every commit in the history but those of a particular author ?
Example :
Authors A and B both modified the folder app/. I need to remove (in the history) every contribution of B to the folder but not those of A.
You can use git filter-branch or BFG
git filter-branchhttps://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
git filter-branch --commit-filter '
if [ "$GIT_COMMITTER_NAME" = "<commiter A>" ];
then
// remove any required data and re-commit it again
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD `
https://rtyley.github.io/bfg-repo-cleaner/

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