Created
July 9, 2018 14:12
-
-
Save awatson1978/e87bc524d15e77b316e8380cd89c720a to your computer and use it in GitHub Desktop.
Remove large files from .git
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
https://www.zyxware.com/articles/4027/how-to-delete-files-permanently-from-your-local-and-remote-git-repositories | |
``` | |
git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FOLDERNAME" -- --all | |
# Once this is done run the following commands to clean up the local repository: | |
rm -rf .git/refs/original/ | |
git reflog expire --expire=now --all | |
git gc --prune=now | |
git gc --aggressive --prune=now | |
# Now push all the changes to the remote repository: | |
git push --all --force | |
``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment