git commit - How to remove history of deleted git subtree folder? -


i added git repository using git-subtree. problem did hard reset before repository added git-subtree. commit history still in repository it's disconnected master.

any idea how remove it? tried git rm --cached no luck.

to remove right away commits unreachable, case of subtree commits, can use following commands:

git reflog expire --all --expire-unreachable=0 git repack -a -d git prune 

git gc not collect unreachable commits, since these (in default configuration) need first expire , not packed other reachable commits. happens on own after while, or can force commands above.

also take consideration reference subtree commits prevent them being collected, includes braches, tags, , reflog references. make sure have not dangling references these commits.

here more detailed question on how dispose unreachable commits:

garbage collect commits in git


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -