I'm doing a small project with git and PHP through the library GIT.php , however I do not know what command to use, or how I can check if a directory is a repository.
I have tried to use
git rev-parse <path> but I have not been successful, I have also tried to check if the
.git directory exists but that does not necessarily mean that it is a repository.
What I want to achieve is to check if a specific directory is a repository, for example:
git [comando] <directorio>
Any suggestions on how I can achieve it?