Created
March 17, 2016 17:24
-
-
Save joostvanveen/96af36a6a8b70ab9f883 to your computer and use it in GitHub Desktop.
Remove big files from git history to avoid error
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
# This command removes any sql.gz SQL backup file from history, even if it was committed a few commits ago. | |
# Handy for big files that throw an error when trying to push. As always, rewriting git history is a | |
# dangerous action! Do not rewrite for commits that have already been fetched by fellow developers. | |
git filter-branch --prune-empty -d /path/to/tmp/scratch/dir --index-filter "git rm --cached -f --ignore-unmatch *.sql.gz" --tag-name-filter cat -- --all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment