We frequently use rebase
, amend
, and other operations on our git repository that have created a lot of "unused" or intermediate commits.
More formally, unused commits are those that meet all of these criteria:
- They do not have any child commits AND
- They are not the
HEAD
of any branch (local or remote) - They are not the
HEAD
of any tag (local or remote)
Is there an easy way to (1) identify this list of commits and (2) permanently remove them?
Thanks!