Git – Why Test on Release Branch Instead of Develop Branch

git

We use the git flow described here. In this way, we have 3 main branches: develop, master, release, and feature branches.

Develop is development. After development starts and features are deployed to develop, QAs merge to release from develop to test on the QA env.

Then fixes go to release, not develop. Release is the main branch now.

Then master is created from release and is put to preprod. Bugfixes are gone to master now.

Then release is created from master and also merged to develop.

But do we need a release branch? Can we do it without a release branch?

Best Answer

If you have one developer you might be able to do it without a release branch. However, you end up with potential downtime while waiting for testing. Git stash makes it easier to switch back and fix bugs. You will need to carefully track which code you are working on.

The failure/usual case when on one branch is:

  • Developer commits work and asks for testing.
  • Some developer commit more work.
  • Testers build and test (not the code that was intended).

Using two or more branches allows testing and bug fixing a release while continuing development of new features. It is common to have one release branch per release.

Another reason to use a separate branch is bugs may require extensive work to to the proper fix, but may have a simple work-around. The work-around gets applied to the release branch. Then the proper fix is done in development. The work around may not get merged back to development.

Related Topic