I've got a git repository with plenty of commits that are under no particular branch, I can
$ git fetch origin
$ git fsck --unreachable
$ git fsck
$ git show 793db7f272ba4bbdd1e32f14410a52a412667042
$ git branch --contains 793db7f272ba4bbdd1e32f14410a52a412667042
No output, nothing dangling (right?)
Note that commits referred to from your reflog are considered reachable.
What exactly is the state of that commit? How can I list all commits with similar state
--no-reflogs to convince
git fsck to show them to you.
How can I delete commits like those?
Once your reflog entries are expired, those objects will then also be cleaned up by
Expiry is regulated by the
gc.reflogexpireunreachable settings. Cf.
git help config.
The defaults are all quite reasonable.