Branches in a GitHub Flow strategy - AWS Prescriptive Guidance

Branches in a GitHub Flow strategy

A GitHub Flow branching strategy commonly has the following branches.

The branches and environments in a GitHub Flow branching strategy.

feature branch

You develop features in feature branches. To create a feature branch, you branch off of the main branch. Developers iterate, commit, and test the code in the feature branch. When a feature is complete, the developer promotes the feature by creating a merge request to main.

Naming convention:

feature/<story number>_<developer initials>_<descriptor>

Naming convention example:

feature/123456_MS_Implement_Feature_A

bugfix branch

The bugfix branch is used to fix issues. These branches are branched off of the main branch. After the bugfix is tested in sandbox or any of the lower environments, it can be promoted to higher environments by merging it to main through a merge request. This is a suggested naming convention for organization and tracking, this process could also be managed using a feature branch.

Naming convention:

bugfix/<ticket number>_<developer initials>_<descriptor>

Naming convention example:

bugfix/123456_MS_Fix_Problem_A

hotfix branch

The hotfix branch is used to resolve high impact critical issues with minimal delay between the development staff and the code deployed in production. These branches are branched off of the main branch. After the hotfix is tested in sandbox or any of the lower environments, it can be promoted to higher environments by merging it to main through a merge request. This is a suggested naming convention for organization and tracking, this process could also be managed using a feature branch.

Naming convention:

hotfix/<ticket number>_<developer initials>_<descriptor>

Naming convention example:

hotfix/123456_MS_Fix_Problem_A

main branch

The main branch always represents the code that is running in production. Code is merged into the main branch from feature branches by using merge requests. To protect against deletion and to prevent developers from pushing code directly to main, enable branch protection for the main branch.

Naming convention:

main