How to remove history of deleted git subtree folder?
I added a git repository using git-subtree. The problem is that I did a hard reset back to before the repository was added with git-subtree. Now the commit history is still in the repository but it's disconnected from master. Any idea how to remove it? I tried git rm --cached with no luck. LopSae To remove right away commits that are already unreachable, which would be the case of your subtree commits, you can use the following commands: git reflog expire --all --expire-unreachable=0 git repack -A -d git prune git gc will not immediately collect unreachable commits, since these (in the default