Answer the question
In order to leave comments, you need to log in
How to version semver in git?
Hello,
I want to understand how it is most rational to version an application using Git and Semver.
We work according to the gitflow principle - there is a dev branch into which commits are merged,
there are branches copied from dev in which development is underway,
and there is a master branch, into which periodically the dev branch is merged
There are several places in the application files indicating the version of the application (for simplicity, we assume that there is only one such place, but it exists)
Let's say there is an index.php file in the dev branch that contains the line Version 1.0.0
Next, the developers start creating new version 1.1.0, they copy the dev branch each to their own new branch, for example, these will be the feat1 and feat2 branches.
Should they change the version in the index.php file at startup? Either one of the developers should do this, for example, in the feat1 branch, or first we should change the version in the dev branch and create a new commit (which will only have 1 index.php file with the changed version, which is not very convenient).
Or in general, developers should not change the version and throughout the development the version in index.php will remain 1.0.0, and at the end a commit will be created in the dev branch that changes the version.
Or in the dev branch, in general, the version should not change and such changes should be in the master branch? It turns out that dev is merged into the master with the old version and then a new separate commit is created in the master after the dev merge in order to correct the version value in index.php? Or perhaps there is some automatic way that will automatically change the version inside the index.php file when merge branches in dev or master? And there are also releases/tags in the git, how to use this functionality along with making changes to index.php?
In general, I have a big gap in understanding how to version with git, I will be grateful for any help or articles on this topic.
Answer the question
In order to leave comments, you need to log in
As far as I remember, gitflow assumes a branch from the dev before the release, into which you can commit, including changing the version.
Let's say there is an index.php file in the dev branch which contains the line Version 1.0.0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question