Proper hotfix/tag workflow

Hello everyone!

Our team is moving to the gitflow model for development of our current website project, and I have a little confusion/questioning about proper workflow.

We currently have our first release, tagged 1.0, and a hotfix release of 1.0.1 already in our repository. Our production site is currently set to track and deploy to the 1.0.1 release.

If we need to make an additional hotfix, or collection of hotfixes, is the correct workflow to pull a copy of main, create a local hotfix branch, make the hotfixes, then merge them back into development and main, and create a new tag like 1.0.2, and then switch the production site to track 1.0.2, or is there a way that we can create the hotfix branch off the most recent release (in this case, 1.0.1), make the hotfix(es), and then push them back up?

It seems like if we make a new tag and change the production deploy to track the newest release, we could end up with a ton of new tags just for quick and dirty hotfixes or whatever.

Or are we doing something wrong?

That’s IMO what Git is all about. Some people will have 2 tags in a 5-year-old repository; others will have 2000. It doesn’t really matter.

What I do is I have a specific branch for prod. You can automate the pulling of that - say, every half-hour. Then releases are only for multiple bugfixes/features.

1 Like

I think the bigger issue is every tag is associated with a release, and the releases page will get filled with 1.0.1, 1.0.2 etc for small fixes. We have “main” which is our “master”, but we are trying to stick to the tagged release model.

@thetechrobo We are running on the Acquia Cloud platform, and they have their own deployment steps they use, and it works off specific branches/tags, so you switch the ‘following tag/branch’ in the UI and it deploys the codebase for that tag/branch to the environment.

I am curious, you said you work off a specific ‘prod’ branch. I am assuming you have a separate branch called like ‘prod’ that you just merge the most recent release into, and run off that? What happens if you have to roll back to a previous release, or move to a new release?