Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for a way automate the "bump version" with git flow

Tags:

I have been using git flow for a couple of months and it has worked very well. I would like to automate the "bump version" operation.

The project is PHP and the footer.php has a token to replace with the current release tag. I am certain that with some awk'ing of git log and the PHP file everything should work out, but I assume someone has done this before...

Any ideas?

like image 257
spdaly Avatar asked Apr 19 '12 12:04

spdaly


People also ask

How do I bump a Git version?

Step 1: Bump Version on Merge Here's a GitHub action to automatically get your most recent version, bump the patch number, tag it, and push the tag: Just throw that in . github/workflows/bump. yml and you're done!

What does bump version mean?

Bump version stands for: It means to increment the version number to a new, unique value.

What is the difference between Git and Gitflow?

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. On the other hand, Git Flow is detailed as "A set of git extensions to provide high-level repository operations".


1 Answers

You could use the semver gem, which adds a file .semver to the root of your git repo. Semantic version numbers are a recommendation for having structured/consistent/meaningful version numbers, the gem just makes it easy to implement.

So, all you'd need to do is add:

semver inc major|minor|patch

into your workflow (manually or scripted) so that the .semver gets updated during a release.

If you don't want the ruby dependency, semver is pretty simple, so a bit of sed experimentation will likely yield a working solution.

like image 72
AD7six Avatar answered Sep 28 '22 08:09

AD7six