git徹底刪除某個文件及其提交歷史

Removing sensitive data from a repository

https://help.github.com/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository

git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch *.tgz' --prune-empty --tag-name-filter cat -- --all
git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
git push --force --verbose --dry-run
git push --force

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章