In big storages, how to detect all folders containing only bare git repositories?
I don't mean just looking for the usual content or some content of git bare repositories, but real valid repositories.
CURRENT APPROACH:
The answer here just find folders having basic content that may look like a git bare repository, so we could improve it trying to execute git status
on every folder matching this basic structure, but I'm not sure it would be the best approach to ensure this is a bare repository, not to say that git status returns the error fatal: this operation must be run in a work tree
on bare repositories requiring us to assume it means a bare repository. So we would have to expect to receive that output for each checking and only thus assume it's a valid git bare repository.
Is there any better way to find them?
See Question&Answers more detail:os