Skip to content

Instantly share code, notes, and snippets.

@markphilpot
Last active February 13, 2022 16:26
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markphilpot/2839641 to your computer and use it in GitHub Desktop.
Save markphilpot/2839641 to your computer and use it in GitHub Desktop.
git :: remove empty commits
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