-
Notifications
You must be signed in to change notification settings - Fork 1
Git Branches Management
Banghua Zhao edited this page Mar 1, 2024
·
4 revisions
-
master
(main
): The default master branch. Source of Truth -
develop
: Branch for developing new features. Created frommaster
. -
task
: Branch for developing new features. Created fromdevelop
. Merge intodevelop
once finished. -
bug
: Branch for fixing bugs. Created fromdevelop
. Merge intodevelop
once finished. -
release
: Branch for releasing a new version. Created fromdevelop
. Merge intomaster
after regression test is done.
Note that release
is only created during the release process by the release captain.
If we have a project tracking system like JIRA, the naming format is:
- For a task/bug branch:
{Branch Category}/{JIRA Ticket Number}/snake-case-name
. For example:task/VABS-1234-ticket-description
- For a release branch:
release/vMajor.Minor.Patch
: For example:release/v2.1.1
If we don't have a project tracking system, the naming format for task/bug is simpler:
- For a task/bug branch:
{Branch Category}/snake-case-name
. For example:task/description
Note that some conventions use name prefixes for each feature (task/bug) name. For example: bz/task/VABS-1234-ticket-desciption
.
The benefit is that it is easier to identify the developer for a large team. I think we don't need to do it at this stage.
- For developing new features or fixing bugs:
- Create a local
task/description
orbug/description
branch fromdevelop
- Finish the development on the local branch.
- Push the local branch to the remote
- Create a new pull request (merge request) to
develop
- No conflict, pass CI, get approval from code review
- Merge the branch to
develop
(MR Option: Delete, Squash)
- Create a local
- For releasing a new version:
- Create a new
task/prepare-[major].[minor]
branch from develop - Update the version to [major].[minor] (and other update like l10n)
- Merge
task/prepare-[major].[minor]
against thedevelop
branch - Once
develop
branch is prepared (task/prepare-[major].[minor]
has been merged into thedevelop
branch), push a release branch following 'release/[major].[minor]' format - MR new
release
branch again themaster
branch (MR Option: Delete, No Squash) - Create a release in GitHub with a new tag (the tag number is the name as the release version number)
- Create a new