Using git, you can use the following approach:
Your git repository may have the following branches. Each patch branch contains a feature release that must be supported.
master - version: 3.0.0 (latest release) \ dev - version: 4.0.0 (next release) |\ | hotfix-1.x - version: 1.0.1 (current hotfix 1.x) \ | hotfix-2.x - version: 2.0.1 (current hotfix 2.x) \ hotfix-3.x - version: 3.0.1 (current hotfix 3.x)
Corrections:
Fixes are fixed in hotfix-1.x and merged up in hotfix-2.x and from there to fix-3.x.
hotfix-1.x β hotfix-2.x β hotfix-3.x ...
Corrections can also be transmitted using the git cherry pick command from hotfix-3.x to hotfix-1.x (if necessary). With the cherry-pick command, you can select one fixed one and apply it in another branch. git will also detect moved and renamed files and still apply this change correctly.
You can also add release branches parallel to patch branches in order to prepare releases in these branches (omitted in this example). This is useful if you do not want to block patch branches for new commits. Please check out gitflow if you want to know more about the details of patches and releases.
Feature Releases:
New features are based on the dev branch and merged back into the dev branch after completion. A new patch branch is created for each new release version.
Steps:
- Merge changes with the current patch on dev
- Merge function returns back to dev
- Create a new patch branch from dev
- Release the new patch .
- Merge with the master
Notes:
I think the main branch is no longer very important when you decide to keep your patch branches. I believe that the general gitflow scheme works so that you delete the patch branches and release the branches as soon as you are done. All issues must be labeled and therefore available.
Jotschi
source share