Last active
February 13, 2022 16:26
-
-
Save markphilpot/2839641 to your computer and use it in GitHub Desktop.
git :: remove empty commits
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
git filter-branch --commit-filter 'git_commit_non_empty_tree "$@"' -f HEAD | |
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment