Project Branching Structure

AndHow uses a slightly modified feature branch strategy for branching. The key things to remember are:

  • After you fork the AndHow project, branch off of the main branch of your fork for each task. This new branch is often referred to as a feature branch, since its a dedicated branch for the development of a new feature (or bug fix, or other change)

  • Submit pull requests (merge requests) of your feature branch to AndHow's main branch

GitHub and the default branch

Unlike most projects, the main branch, where development is done, is not the default branch. The default is the homepage branch. The reason is that GitLab displays the default branch and its much better to display the latest released code, rather than the current head of development.

Not displaying the development branch is especially useful when the API changes between releases - We really don't want to show examples of an unreleased API in the readme.md, yet it often takes a few days to create good examples. Working on them behind the scenes on the main branch is a nice solution.

The key branches are:

main - This is the branch that contains all latest code. When you start a task you start from this branch, and when you submit a pull request it goes to this branch.

[Your Repository]/Issue###-Short-issue-name - This is a feature branch in your repository. When you start work on an issue, pull in the latest code from main to your personal main branch, then branch to create a feature branch with a name like shown. When you complete your work, push that branch to your fork on GitHub, then put in a pull request from your feature branch to canonical main.

homepage - This branch is based at the latest released version and is the default branch displayed when a user visits the AndHow GitHub project.

release - A separate branch for creating a release. It may only be visible during release creation.

x.x.x - A branch for a particular release. These get created occasionally, but don't have any particular conventions.

[some other feature branches] - One limitation of GitHub is that the project owner cannot create a fork of their own project - the project itself is their 'private' fork. Thus, other feature branches in the project are probably the project owner's because they have no other place to put them :-)

Last updated