Created
October 19, 2019 22:55
-
-
Save Jamim/dc2b6ed041b13d6d8305388768186dbc to your computer and use it in GitHub Desktop.
Clean up the twint repository
This file contains hidden or 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
#!/bin/bash | |
# !!! WARNING !!! | |
# Before you execute this script you should backup your repository. | |
# https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#_the_nuclear_option_filter_branch | |
git filter-branch --prune-empty --tree-filter 'rm -rf graph/node_modules' -- --all | |
# https://stackoverflow.com/questions/7654822/remove-refs-original-heads-master-from-git-repo-after-filter-branch-tree-filte | |
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d | |
git reflog expire --expire=now --all | |
git gc --aggressive --prune=now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment