Skip to content(if available)orjump to list(if available)

Git CLI tool for intelligently creating branch names

r1cka

I think people worry too much about branch names. Feature branches are usually ephemeral. Prefix your branch with your personal identifier so I know who is primary on it and worry more about the commit message which will live on indefinitely.

morkalork

Yes, please just name the branch after the ticket/issue number so we can all get the context for it and call it a day

jasonjmcghee

This. Linear has the one click or shortcut to grab the generated branch name based on the ticket.

With GitHub setup properly, on PR open, it auto comments the link to the ticket and links to the pr in the ticket.

dewey

This is probably my favorite Linear feature.

1) Cmd + shift + . -> Copy branch name

2) Build feature on that branch name

3) Build / Merge on Github and Linear closes the issue

wara23arish

I hate issue numbers for branch names. ISSUE-9482 doesn’t really provide much.

Ticket link should always be included in PR description.

But branch names should be descriptive like terraform_dev_create_instance

etc

jjgreen

I've worked in a couple of places with <issue ID>-<something descriptive> conventions, moderately useful

6LLvveMx2koXfwn

we do:

  [feature/bug]/ISSUE-NUMBER-summary-of-issue
e.g.:

  bug/psi-456-broken-args-parsing

alkonaut

having feature/username/id-desc is good though. Because at least you can identify why the branch is there. That they are ephemeral doesn't mean that people actually clean them up...

delusional

Either it has commits I care about or it doesn't. Either way, I'm not going to consult the branch name.

If it has commits I care about, then it stays. If it doesn't, It goes. I'm only deleting on the server afterall, people can just push it back.

loevborg

Correct, I use uuids as branch names, to the chagrin of my teammates

brettgriffin

This would infuriate me. You have to index that guid to something yourself. Why wouldn't you at least give yourself some help (your name, issue number, type of change, area of project, etc). Why make your job harder than it needs to be?

aizk

Great point

focom

Commit message should be ephemeral too. Squashing after a PR should be the default. Only at that moment does the PR/Commit message matter.

bavent

Hard disagree here. GitHub does encourage this sort of thing, but even there for my PRs to be easily reviewable, I like to keep my commits organized and with good messages explaining things. That way the reviewer can walk the commits, and see why each thing was thing was done.

I also like it for myself, when I’m going over my own PRs before asking for a review - I will often amend commits to ensure the work is broken down correctly, each thing that should go together, does.

In a way, stacked PRs are just a higher-level abstraction of this too - same idea, keep work that goes together in the same place.

freedomben

Fully agree with you here. Blunt squashing is a bandaid to the problem of lazy commits. Commits should IMHO be specific and atomic. Like fixing one bug or implementing one feature. Obviously there are cases where this ideal isn't practical, but the answer is still not squash everything, it's to think for 10 more seconds about the commit and do your best.

focom

> In a way, stacked PRs are just a higher-level abstraction of this too - same idea, keep work that goes together in the same place.

You downvote me but you just agreed with me. When was the last time you read individual commits of a PR? If your PR need to keep the history of the commits that means that you should split your PR into smaller one.

celticninja

I think branch names are quite unimportant in development and often don't worry about them being too descriptive.

In my org it is common to use the JIRA ticket number in there somewhere but other than that I think you should leave it up to devs. I can't think of a reason why I would need to know the branch name.

My favorite branch name I created was for a JIRA ticket with the number 2468.

This became ab-2468-who-do-we-appreciate

Detailed branch naming conventions are just another piece of useless documentation for devs. And if you are using the branch name to tell you what is going on the you are misunderstanding the review process.

paradox460

I rarely make named branches these days. Just use JJ git push -c, which creates a branch name based off the change I'm pushing

teiferer

I was so afraid that this is another "look I built sth that uses AI!" post, slopped together in an afternoon. I'm glad it's not, such a relief!

This reaction tells me a lot about the state of our industry. (Or just the state of my mind.)

dcre

Sounds similar to a short script I use to generate branch names with jj, which has the advantage that you don’t have to name a branch until after you’ve already written the code, so the LLM can name it based on the contents of the diff.

https://crespo.business/posts/overeng-pr-create-jj/

spencera

I think in 2025 "intelligently creating" kind of implies the use of AI but (thankfully) this is just doing a string format based on an issue title.

roflchoppa

a format that as worked well for me (and that I've brought with me to other teams)

``` issues/{username}/{issue-number}-{description} ```

The username prefix is helpful, for both organization, and locating branches.

davelee

I use the `%f` format option. I have a `bn` alias ("branch name"):

git show --no-patch --format=%f [<commit>]

compilethread

Simple and clear branch names make teamwork so much easier.

pat_erichsen

Neat! Linear does this really well with a few different configurable patterns.