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-branch
https://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 `