DEV Community

Discussion on: How do you name your git branches?

Collapse
 
ben profile image
Ben Halpern

If I were less lazy, I'd probably reference an issue number, but I usually give my name and a description of the general task. In looking at current branches:

  ben/add-haptic-feedback
  ben/small-meta-fix
  ben/some-gardening
Enter fullscreen mode Exit fullscreen mode
Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
wolverineks profile image
Kevin Sullivan

start a new branch from there?

Collapse
 
ewoks profile image
Beeblebrox • Edited

why your name is relevant to the feature? does someone who takes it over (in case you get sick or you take 1y off time) needs to rename it? Just my curiosity... Thanks

Collapse
 
wuz profile image
Conlin Durbin

This is pretty much what I do, our agile tracking software at work (Clubhouse) gives you tags based on the issue number, which automatically connects the ticket to the branch. You end up with branches that look like this:

wuz/ch1234/story-name-from-clubhouse

They have a nice copy button, which makes it easy to check out new branches.

If I am working on a non-work project, I use:

wuz/name-of-thing-i-am-doing
Collapse
 
nadawoud profile image
Nada

Why is your name important in naming a branch? To indicate the assignee? What happens if the issue gets re-assigned?

Collapse
 
aeharake profile image
Ahmad El Harake

Good point Nada

Collapse
 
dothtm profile image
dotHTM • Edited

I got a little too generic at one point, reused a branch name and halted the server's code from updating (the person reporting the stall didn't know git fetch --prune … my office is a relatively recent git convert. don't judge… ).

I use a version of Ben's:

my-initials/dev2018/feature

Useful side effect: keeps little reminders for myself come time for annual self evaluation.