← Retour au blog
tech 20 May 2026

Enhance Generated Branch Names with jj

Clearer branch names with jj through custom configuration. Learn how to optimize your workflow with practical examples.

Article inspired by the original source
Better generated branch names with jj ↗ ddbeck.com

Introduction

In the world of software development, version control is crucial for organizing and tracking code changes. While Git is the standard tool, jj (Jujutsu) is gaining attention for its compatibility and unique features. However, one area that could be improved is how jj generates branch names. Fortunately, jj can be configured to produce more meaningful and readable branch names.

The Issue with Default Branch Names

By default, jj generates branch names based on the change ID, such as push-xyz. While this method ensures uniqueness and a quick match with changes, it lacks readability. If you're looking at a list of branches on GitHub, it's hard to know what push-xyz actually represents without manually checking.

The Solution: Customization with Template Aliases

To address this issue, you can use template aliases in jj. Here's how you can do it:

``plaintext [template-aliases] "slugify(str)" = ''' truncate_end(65, str.first_line() .replace(regex:'[^[[:alnum:]].]', '-') .replace(regex:'-{2,}', '-') .replace(regex:'\.\.', '.') .replace(regex:'(^-+|-+$)', '') .lower()) ''' [templates] git_push_bookmark = 'slugify(description) ++ "/" ++ change_id.short()' ``

This code allows you to generate a branch name that includes a "slugified" version of the change description (often the commit message in Git), followed by a short version of the change ID. For example, a change with the description "Add note about jj bookmark templates" might produce a branch name like add-note-about-jj-bookmark-templates/ozkspkuyzpwu.

A Practical Example

Suppose you're working on a project where each feature needs a dedicated branch. With jj, you create a branch to add an authentication feature. Instead of having a branch named push-abc123, you would get something like authentication-feature/abc123, which is significantly more understandable.

Why Does It Matter?

Clear branch names offer several benefits:

  • Improved Communication: Other developers can understand the purpose of the branch without digging into its details.
  • Simplified Management: Tracking and merging branches becomes more intuitive.
  • Ease of Maintenance: In the long run, finding a specific feature or bug is faster.

Conclusion

By configuring jj to generate more readable branch names, you not only enhance your workflow but also that of your entire team. This small tweak can make a big difference in daily project management. Want to go further? Let's discuss your project in 15 minutes.

jj version control branch names Git template configuration
Deepthix newsletter · 100% AI · every Monday 8am

An AI agent reads tech for you.

Our AI agent scans ~200 sources per week and ships the best articles to your inbox Monday 8am. Free. One click to unsubscribe.

Visit the newsletter page →

Want to automate your operations?

Let's talk about your project in 15 minutes.

Book a call