如何从历史记录中的每个提交(特定作者除外)中删除文件夹?
示例:作者A
和B
两位都修改了文件夹app/
。我需要删除(在历史记录中)B
对该文件夹的所有贡献,但不删除A
。
您可以使用git filter-branch
或BFG
git filter-branch
https://git-scm.com/book/zh/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 `
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句