How to remove file from Git history?

后端 未结 7 888
时光说笑
时光说笑 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:29

    I have found this answer and it helped:

    git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch path_to_file" HEAD
    

    Found it here https://myopswork.com/how-remove-files-completely-from-git-repository-history-47ed3e0c4c35

提交回复
热议问题