Open horenso opened 7 months ago
Thx for reporting! I agree with including the username and issue number makes sense.
In GitLab when clicking on "create branch" in an issue, a branch <issue number>-<title-of-issue>
gets created by default. But you can choose any other name for the branch when pressing the little arrow on the right.
So we can easily use <username>/<issue number>/<title-of-issue>
.
I think there is little benefit from including even more information.
Since we transition to a fresh repo on Gitlab, it may be a good time to rethink how we name branches.
At my current workplace, we adopted the following structure for naming our branches:
Where
username
is just a unique shorthand or nickname. We also prefix our commit messages with the issue number, such that the history is easily searchable.There are several things one could include in the branch name:
category
: We've been labeling branches with tags like "feature" or "bugfix." But, given that most updates generally aim to enhance some aspect of the application—be it through bug fixes or feature improvements—I believe it's enough to outline this distinction in the PR (MR 😉) summary.username
: The key benefit here, from my perspective, is the ease of managing your own remote branches. Whether it's force-pushing or deleting, it allows for a cleaner overview of which branches are out there but haven't been merged yet.issue-numer
: We should absolutely keep using issue numbers :)I'd be very interested to know what naming conventions you all used in different projects and what suggested you might have 🙃