我最近注意到我在git中的版本控制下有一个包含敏感信息的文件。现在,我已将此文件添加到.gitignore列表中,但是如何在不触摸其他内容的情况下从提交历史记录中删除所有提及的文件?即,我不想只删除我的.git目录。
在 GitHub 帮助站点上尝试本指南:https : //help.github.com/articles/remove-sensitive-data
具体来说:
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch Rakefile' \
--prune-empty --tag-name-filter cat -- --all
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1773 次 |
| 最近记录: |