DEV Community

Discussion on: Git Concepts I Wish I Knew Years Ago

Collapse
 
rafo profile image
Rafael Osipov

I would suggest the following approach to name branches. Assume your team is working on a project with name "Acme Project".

Assign an abbreviation to the project, let say this abbreviation is "ACM".

Then assign tasks in JIRA (or another tracking system) and assign unique number to every task. For example:

ACM-1: Implement "About" dialog.
ACM-2: Fix printing issues.
ACM-291: Refactor "Customer" class and reduce methods complexity and size.

Then assign these tasks to developers.

Upon getting a task, let say ACM-2, a developer creates a local branch with the same name: ACM-2, and works on it. Then it pushes this branch to the remote and makes Pull Request to the master. As the pull request approved and merged, the remote branch ACM-2 is being deleted and the relevant task is being marked as Done.

This approach simplifies communication and task/branch referencing inside of team and I recommend it.

Collapse
 
g_abud profile image
Gabriel Abud

Yeah agreed that this makes sense if you use Jira. Not everyone uses project management tools like Jira though.

Collapse
 
devimposter1 profile image
devimposter

Maybe not Jira but they should be using something!!! Even working alone it's worth using these tools. Kanban, etc. You can do it free with a Gitlab or Azure DevOps account, so why not?

Thread Thread
 
jaymcconnon profile image
James McConnon

Agreed, i just managed a solo project with gitkraken boards and github issues and i am so glad i did. Kept me on task and eventually was the basis for my generated changelog.

Collapse
 
bimlas profile image
bimlas

I also follow this kind of branch name and wrote a prepare-commit-msg hook for it, which (among other things) places the issue tracker URL in the commit message based on the branch name.

gitlab.com/bimlas/home/-/blob/f826...