Regardless of whether you work as the only TAE on the project or with multiple people, there are some good practices you should follow when naming your git branches.
We can divide them into:
- permanent branches
- temporary branches
Permanent branches will most likely stay in your repository permanently.
- must always be stable
- should be up-to-date
- new code should only be merged after a code review
- merge without PR should be disabled in repository settings
- branch deletion should also be disabled, just in case :)
- should not be used for experimenting with new code
- can be used for checking new code
- should be used for reviews
- gets merged into main after passing a code review
Temporary branches, as the name indicates, are meant to live in the repository temporarily. Before starting work on a new feature or a test, you should check out a new branch. Once you are done with your work, and made sure everything works as expected, you can continue with merging the branch to develop/main after passing the code review.
While permanent branches are mostly to be the same on all projects, you will have some more freedom with naming your temporary branches. Branch names should be short yet meaningful.
Often used names, or rather prefixes, are:
To further make clear what is being worked on in a specific branch, you can add a unique ID to the name, as well as a hyphen, underscore, and slash. You can even add the author's name in the branch name to further distinguish who is working on which branch.
Whichever method you decide on, make sure to keep using it consistently.
Good branch names:
Bad branch names: