According to the man page, git gc
will not garbage collect files which are referenced through the 'reflogs' (.git/logs/<ref-name>
files in your repository). These HEADs are exactly what SmartGit/Hg displays and when you remove these logs, the unreferenced commits should be collected by a git gc --prune=now
.
Warning Unless there is no really good reason to completely get rid of these commits (like removing sensitive data), you shouldn't do that -- maybe some time later your might be interested in exactly one of these commits. At least, reclaiming disk space is no good reason, in my opinion.