git - 使用bfg的参数是什么
问题描述
我正在尝试使用bfg从我的 git repo 中清除一些东西。作者的指示建议
java -jar bfg --replace-text passwords.txt my-repo.git
我理解这些是什么意思
java -jar bfg.jar --replace-text <some text?> <a directory?>
但是我所有提供文本和目录的努力都会出错Error: Option --replace-text failed when given 'some-text'. some-text (No such file or directory)
。有没有人弄清楚如何使用bfg?
我的目标是从我的历史记录中删除一个短字符串(可能只出现在一个文件中,但我不能确定)
解决方案
rtyley/bfg-repo-cleaner
问题 154提供了以下示例:
因此,您创建了一个名为 eg的文件
replacements.txt
,并将类似这样的内容放入其中 - 每个密码、凭据等一行:PASSWORD1 # Replace literal string 'PASSWORD1' with '***REMOVED***' (default) PASSWORD2==>examplePass # replace with 'examplePass' instead PASSWORD3==> # replace with the empty string regex:password=\w+==>password= # Replace, using a regex
...然后运行 BFG,指定替换文件:
$ java -jar bfg.jar --replace-text replacements.txt my-repo.git
您应该将短字符串放入测试文件中。
推荐阅读
- python - 是否有任何内置函数可以在 Python 中获取负整数的二进制格式?
- json - 将正确的 json 对象分配给类
- json - 如何解析以下字符串2数组
- c - 欧拉项目第58题,错误在哪里
- database - 如何使用 mongoDB 找到没有评分或评论的电影的标题
- java - 无法在 EC2 实例上远程调试 Java
- reactjs - 如何在es6中格式化数组数据
- python - 我想通过使用网络摄像头将捕获图像添加到我的 PyQt gui 窗口中,网络摄像头图像将出现在 gui 窗口中
- visual-studio - 如何从 VS2017 的团队资源管理器窗口提交?
- java - Java注解否定逻辑