簡體   English   中英

Git:使用bfg(beg-repo-cleaner)刪除特定文件

[英]Git: Delete a specific file using bfg (beg-repo-cleaner)

我正在嘗試從Git歷史記錄中永久刪除文件,因為它包含敏感數據。

為此,我正在使用bfghttps : 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM