Getting GIT build hash outside the current directory
问题 I'm using CMake to do an out-of-core/out-of-source build of my project, and want to include the result of a "git describe --tags --dirty" as a version number in the project (just for reference on bugs). However, any attempt to try and tell git where the code repo is results in an error like "fatal: Not a git repository (or any of the parent directories): .git". Is there a way to specify where git should look for the repo, other than the current working directory? 回答1: Or you can use the