我希望使用
因此,我想仅将操作应用于我正在推送的最新几个提交,而不触及旧历史记录中的任何内容。
有没有办法做到这一点?
为了具体说明,这里有一个测试库:https://github.com/cirosantilli/test-git-filter-repository和一个示例blob操作:
git filter-repo
自动应用一些脚本化的样式指南重构,以处理我的多次提交请求。因此,我想仅将操作应用于我正在推送的最新几个提交,而不触及旧历史记录中的任何内容。
有没有办法做到这一点?
为了具体说明,这里有一个测试库:https://github.com/cirosantilli/test-git-filter-repository和一个示例blob操作:
# Install git filter-repo.
# https://superuser.com/questions/1563034/how-do-you-install-git-filter-repo/1589985#1589985
python3 -m pip install --user git-filter-repo
# Usage.
git clone https://github.com/cirosantilli/test-git-filter-repository
cd test-git-filter-repository
printf 'd1==>asdf
d2==>qwer
' > replace.txt
git filter-repo --replace-text replace.txt --refs HEAD
上述方法将影响测试仓库的所有3个提交。例如,有没有一种方法只影响最后2个提交呢?
对于我的用例,blob操作应该完美地工作,因为我只想处理我的提交修改过的blob。
我在文档中没有轻松找到相关信息。
我还在他们的问题跟踪器上提出了问题:https://github.com/newren/git-filter-repo/issues/157
已经在git-filter-repo ac039ecc095d上进行了测试。