Misha Moroshko
Misha Moroshko

Reputation: 171321

Git: How to clear empty directories in .git/refs/heads?

I've created a new feature/cool-stuff branch. Git created the .git/refs/heads/feature/cool-stuff file as expected.

Now, I deleted the feature/cool-stuff branch. Git deleted the .git/refs/heads/feature/cool-stuff file as expected.

But, the .git/refs/heads/feature directory is still there (it's empty).

I guess I could delete this directory manually, but I wonder if there is a Git cleanup command that would do that for me?

Upvotes: 2

Views: 446

Answers (1)

linquize
linquize

Reputation: 20366

find .git/refs -empty -type d -delete

Upvotes: 3

Related Questions