Created
November 5, 2019 09:39
-
-
Save mozhu1024/6e208a9d0b6205ef63999235e34a4538 to your computer and use it in GitHub Desktop.
[GFB-GC] Git永久删除文件和历史记录 #git #gfb #shell #cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin | |
git reflog expire --expire=now --all | |
git gc --prune=now | |
git push origin --force --all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment