Answer the question
In order to leave comments, you need to log in
How to put the version number of the php project through git?
Hello
I would like to automate the process of putting down project versions. For example, specify the version number in the tag of one of the commits, and then, based on this tag and the number of commits, indicate on the page the name of the form "'Version_number' assembly 'number_of_commits' from 'date'". Can you please tell me how to implement it correctly?
Answer the question
In order to leave comments, you need to log in
I think you need to dig here: git-scm.com/book/en/Customizing-Git-Git-Hooks I'm
too lazy to dig myself now. Please post if you find a solution.
On the example of SVN: run through system (svn info) then take the necessary information, and the commit number and date of the commit and display it on the page.
Hm. I don't know how it is in PHP, but in C++ projects, you can do without hooks. Here is an example:
Project file:
VERSION = $$system(git describe --tags)
isEmpty(VERSION) : VERSION = 0.9.02-dev
DEFINES += APP_VERSION=\\\"$${VERSION}\\\"
...
setApplicationVersion(QLatin1String(APP_VERSION));
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question