Removing nested folders with BFG Repo Cleaner

916 views Asked by At

There is one large directory, called docs, with a lot of nested directories, some of which have 2 more levels of directories inside them, that I want to get rid of entirely. Running java -jar ~/bfg-1.12.15.jar --delete-folders docs actually made the repo slightly larger, though it seemed to execute fine. It listed the dirty and modified commits, the changed objects, and logged a report.

Is the issue that it doesn't removed the nested directories, only the top level one? Can it remove things recursively?

1

There are 1 answers

4
kim holder On

Ah, the issue was I hadn't yet run the commands git reflog expire --expire=now --all && git gc --prune=now --aggressive, and so the size reduction was not yet visible. And by testing, it is clear it does remove nested folders, as trying to remove one that was part of a deleted parent folder showed nothing to delete and the program aborted.

As I've only done this a little and am new to it all, this sort of thing is easy to forget.