Calling Git from .pro - 'git' is not recognized as an internal or external command
-
Hey guys, so I am trying to pull my version from Git's tags.
I am working on Windows 7 pro.
Here is what I have in my .pro file.
GIT_VERSION = $$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --always --tags) DEFINES += GIT_VERSION=\\"$$GIT_VERSION\\" VERSION = $${GIT_VERSION}
The error i get is: 'git' is not recognized as an internal or external command, operable program or batch file.
I run this same section of .pro file for another project on another machine, it does not have this issue.
I am also able to call git from cmd window on the problem machine and it recognizes the command just fine.Any ideas on how to solve? I have tried adding git.exe to PATH for windows environment variable, also set the prepend to path under tools for the git version control.
Thanks,
Shawn -
Hi,
Shouldn't you be calling
git.exe
rather than justgit
? -
I came in this morning and went to try it again. It seems to be working. I had to add these lines in after because it was saying that there was a syntax error in the .rc file.
VERSION = $${GIT_VERSION} win32 { VERSION ~= s/-\d+-g[a-f0-9]{6,}// }
I am pretty sure the solution was that I reinstalled the git for windows, and made sure I selected command line interface for windows in the installation. I think I had to restart Qt Creator which I did not do last night, this morning I came in and started Qt Creator up and it worked(I did not restart the machine). It also seems I can use git.exe or just git. I am going to mark as solved, than you all for the help :)
-Shawn
-
I came in this morning and went to try it again. It seems to be working. I had to add these lines in after because it was saying that there was a syntax error in the .rc file.
VERSION = $${GIT_VERSION} win32 { VERSION ~= s/-\d+-g[a-f0-9]{6,}// }
I am pretty sure the solution was that I reinstalled the git for windows, and made sure I selected command line interface for windows in the installation. I think I had to restart Qt Creator which I did not do last night, this morning I came in and started Qt Creator up and it worked(I did not restart the machine). It also seems I can use git.exe or just git. I am going to mark as solved, than you all for the help :)
-Shawn