Created
September 17, 2014 12:39
-
-
Save x684867/48101a206ba33443c962 to your computer and use it in GitHub Desktop.
This gist covers how to prune large files from a git repo when moving from gitlab to github. It's also helpful for times when someone commits a large .war .iso or other file to the repo.
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
# Example specifies *.war. | |
# | |
# It would work for *.log for developers who git -A . when they shouldn't and upload the contents of /var/log/* | |
# Just change the --ignore-unmatch parameter. | |
# | |
git filter-branch \ | |
--prune-empty \ | |
-d ../scratch \ | |
--index-filter "git rm --cached -f --ignore-unmatch *.war" \ | |
--tag-name-filter cat -- --all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment