3

How to permanently delete a commit from a removed branch so that it becomes unreachable?

* aa448ae (orphan) 
| * 1c0c419 (HEAD -> master) 
|/
* 0bfa9c3 

git branch -D orphan
git gc --prune=all
git filter-branch

And it's still available when I do:

git show aa44

or:

git branch test aa44

1 Answers1

2

To remove all dangling commits and those reachable from the reflogs:

git reflog expire --expire-unreachable=now --all
git gc --prune=now
Bless
  • 5,052
  • 2
  • 40
  • 44