On Windows Git has problems with refs differing only in the case:
$ git branch foo
$ git branch FOO
fatal: A branch named 'FOO' already exists.
$ git branch dir/foo
$ git branch DIR/bar
$ git branch --list
* develop
foo
dir/bar
dir/foo
That can be explained by Git using the file system to store the refs as a file foo
and bar
inside the directory <repository>/.git/refs/heads/dir
.
$ git branch --delete dir/bar
$ git branch --delete dir/foo
$ git branch --list
* develop
foo
Older Git versions seem to have left some empty directories in <repository>/.git/refs
where newer Git versions remove them.
Is it safe to remove empty directories in <repository>/.git/refs
manually?