How to remove file from Git history?

后端 未结 7 835
时光说笑
时光说笑 2020-11-28 03:04

Some time ago I added info(files) that must be private. Removing from the project is not problem, but I also need to remove it from git history.

I use Gi

相关标签:
7条回答
  • 2020-11-28 03:47

    I read this GitHub article, which led me to the following command (similar to the accepted answer, but a bit more robust):

    git filter-branch --force --index-filter "git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA" --prune-empty --tag-name-filter cat -- --all
    
    0 讨论(0)
提交回复
热议问题