似乎git filter-branch已被弃用,应该使用git-filter-repo。我正在使用git filter-branch --index-filter从提交中删除一个文件列表,这些文件不是给定提交的后代。这是这样做的
git filter-branch --index-filter 'git merge-base --is-ancestor aaaaaaaa $GIT_COMMIT ; if [ $? -eq 1 ] ; then git rm --cached --ignore-unmatch a.txt b.txt c.txt ; fi' HEAD因此,从任何不是aaaaaaaa后代的提交中删除了a.txt、b.txt和c.txt。有什么方法可以通过git-filter-repo实现这一点吗?
发布于 2021-06-14 03:08:36
利用git filter-branch的优势,使用git filter-repo的优势。我怀疑是否有可能让filter-repo做你想做的事情,或者至少不是那么好。
我建议忽略大多数针对git filter-branch的批评,特别是filter-repo自述文件中的批评,令人遗憾的是,这些批评被夸大了。将export FILTER_BRANCH_SQUELCH_WARNING=1放在~/.bashrc中,然后就可以使用它了。
https://stackoverflow.com/questions/67961146
复制相似问题