[英]Git: Delete a specific file using bfg (beg-repo-cleaner)
我正在尝试从Git历史记录中永久删除文件,因为它包含敏感数据。
为此,我正在使用bfg
: https : bfg
该文件称为app/config.json
。
但是我不想删除其他文件夹中的其他文件config.json
。
我尝试了以下方法:
git clone --mirror git://example.com/some-repo.git
bfg --delete-files app/config.json my-repo.git
但我收到错误消息:
Error: *** Can only match on filename, NOT path *** - remove '/' path segments
如何仅删除此特定文件?
“警告:将提交推送到GitHub后,您应该考虑其中包含的任何数据都将被泄露。如果您提交了密码,请进行更改!如果您提交了密钥,请生成一个新的密钥。” https://help.github.com/articles/removing-sensitive-data-from-a-repository/
cd my-repo/app
bfg --delete-files config.json
您也可以尝试:
bfg --replace-text config.json
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.