【发布时间】:2018-11-12 20:41:23
【问题描述】:
如何为我的 git 子模块中的所有先前提交重命名短语?
phrase1 to phrase2
我的短语可以在 .pack 文件中找到。 (我缩短了十六进制 .pack 名称):
$ grep -rnw . -e 'phrase1'
Binary file ./.git/modules/folder1/objects/pack/pack-6170d.pack matches
Binary file ./.git/modules/folder2/modules/objects/pack/pack-934ef.pack matches
Binary file ./.git/modules/folder2/objects/1b/2eeaa matches
Binary file ./.git/modules/folder2/objects/1e/92b8b matches
Binary file ./.git/objects/54/fcce26 matches
我尝试在 repo 上运行 BFG,但得到以下输出:
java -jar bfg-1.13.0.jar -rt expression_file.txt /my_repo/
...
BFG aborting: No refs to update - no dirty commits found??
...
我尝试使用“--no-blob-protection”参数运行 BFG,但得到相同的输出:
...
BFG aborting: No refs to update - no dirty commits found??
...
我的 expression_file.txt 格式如下:
phrase1 ==> phrase2
我研究过使用“git filter branch”,但我不确定要给它什么命令来让它重写这些文件。
【问题讨论】:
标签: git bfg-repo-cleaner