Skip to content

Using a Maintenance Branch

gregjan edited this page Aug 8, 2012 · 3 revisions

Using a Maintenance Branch

This page will show you how to create and use a maintenance branch from any commit or from a release tag.

Creating the branch

  1. check for existing maintenance branch so as not to duplicate
  • git pull - first update local repository from remote
  • git branch -l - list branches
  1. find the starting point (commit or tag). Look at the history or tag list to find the starting point you want:
  • git hist - find commit ids
  • git tag -l - find release tags
  1. create a new tracked remote branch
  • git checkout --track -b <major version>.x <tag/commit>, for example git checkout --track -b 2.x 2.0
  1. update POMs to next minor SNAPSHOT version
  • mvn versions:set -DnewVersion=<version+1>-SNAPSHOT -DgenerateBackupPoms=false (inserts new version into POMs. increment the proper version digit)
  • vim pom.xml - update the cdr-version property in parent POM (updates dependencies)
  • We will create tags for minor releases, but will use the one maintenance branch per major version.
  1. fix bugs
  • Fix bugs on the branch and commit changes to your local repository.
  • Optionally consolidate/squash commits together with git commit --amend or git rebase -i
  • Push changes to remote repository

Performing a maintenance release

  • follow the normal release procedure to deploy a maintenance branch.

How to merge minor fixes into a major branch

  1. Commit your fixes on the proper release maintenance branch. (How to release the cdr)

  2. Before any major release and at any time prior to that, perform a biased merge from maintenance to master (or major release branch).

  • git checkout <branch>, where branch is the major branch or master
  • git merge -s recursive -X ours <fixes-branch> (In a conflict this will keep the master change.)
  • commit the merge, if not done automatically.
  • push the major/master branch back to origin