Last active
October 10, 2017 19:05
-
-
Save filipkral/a79b8f7d8df20a83d0e5d3be0f186be9 to your computer and use it in GitHub Desktop.
Reduce repository size after you accidentally committed a large file.
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
# given that you accidentally added a large file to git branch feature/adding, then removed it in another commit, you can reduce the repo size by the following commands | |
# for more details and alternatives see https://confluence.atlassian.com/bitbucket/reduce-repository-size-321848262.html | |
git checkout develop | |
git merge --squash feature/adding | |
git branch -D feature/adding | |
#git reflog expire --expire=now --all | |
git gc --prune=now | |
git commit -m "Merged" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment