best branch strategy release code example
Example 1: branching strategy in your company
Our test framework is separate repo from the
application code repo. Automation framework
has a smaller code base, and fewer people are involved.
so we do not have a very complicated branching strategy
We have master and develop branches(buffer branch)
in our automation framework repository.
Once I have a story from jira, I create a
new branch from the develop branch with the
issue number of my jira story and check out.
git branch <branchName>
git checkout -b vyt-59I
write my automated tests on this branch.
Once completed, I create a pull request
so that my code can be reviewed. Once my
team reviews the code, my branch is merged into develop.
After code is merged, I delete the branch.
git branch -d <branch_name>
Then get another story from jira,
create new branch for that one ...
At the end of every sprint, (or quarter)
we merge with master.
My daily automated smoke
from Jenkins runs against the master branch.
Master branch is stable since
we only merge into with once a sprint.
Example 2: gitflow workflow diagram
$ git checkout -b myfeature develop
Switched to a new branch "myfeature"
Example 3: branch strategy
There is master branch and separate branches for each team member.
when someone finishes work, they push to their own branch, then after
reviewing it is merged to master.
HOW WE DID IT?
In my project we had master, develop and branch for person. so, if we have
2 automation testers, we will have:
- Master
- Develop
- Tester1
- Tester2
- Tester3
Each tester checks in to their own branches. Then after reviewing it is
merged to develop branch. We merge master and develop only once a sprint.
In my project, our code is separate repo from the application code repo.
Automation framework have a smaller code base and fewer people involved. So,
we can have less complicated branching policy.
My daily automated smoke from Jenkins runs against the master branch.
Master branch is stable since we only merge to with once a sprint.