Skip to main content

A Git CLI tool for intelligently creating branch names

Project description

Tests Coverage PyPI version Downloads Python versions License GitHub stars GitHub issues

gibr

🧩 A smarter CLI for creating Git branches.

gibr connects your Git workflow to your issue tracker — instantly creating consistent, descriptive branches. Fully configurable, and ready for any tracker or team setup.

Currently supporting integration with:

GitHub GitLab Jira Azure Linear

Usage

# List open issues
$ gibr issues
|   Issue | Type   | Title                                 | Assignee   |
|---------|--------|---------------------------------------|------------|
|     123 | issue  | Add support for OAuth2 / login (beta) | ytreister  |
|      97 | issue  | Add support for gitlab                |            |
# Decide which issue to work
$ gibr 123
Generating branch name for issue #123: Add support for OAuth2 / login (beta)
Branch name: ytreister/issue/123/add-support-for-oauth2-login-beta
✅  Created branch 'ytreister/issue/123/add-support-for-oauth2-login-beta' from main.
✅  Checked out branch: ytreister/issue/123/add-support-for-oauth2-login-beta
✅  Pushed branch 'ytreister/issue/123/add-support-for-oauth2-login-beta' to origin.

🚀 Quick start

Installation

Install the base package

pip install gibr

or if you use uv

uv pip install gibr

🧩 Optional dependencies

gibr supports multiple issue trackers, but you only need to install the dependencies for the ones you actually use.

Each tracker’s client library is an optional extra.

Tracker Extra name Install command (can prepend with uv if you use it)
GitHub github pip install gibr[github]
GitLab gitlab pip install gibr[gitlab]
Jira jira pip install gibr[jira]
Azure azure pip install gibr[azure]
Linear built-in N/A

Note: You can also install multiple trackers at once, for example:

pip install gibr[github,jira]

Initial setup

Run gibr init to set up your configuration interactively. This will create a .gibrconfig file in your project root with the correct format for your chosen issue tracker.

Setup git aliases commands (optional)

Run gibr alias to set up git alias commands for your conveinence. This essentially allows you to extend the git CLI with gibr commands. See alias command for more details

Commands

init

gibr includes an init command to help you create your .gibrconfig file. See the following usage example:

$ gibr init
Welcome to gibr setup! Let’s get you started 🚀

Which issue tracker do you use?
1. AzureDevOps
2. GitHub
3. GitLab
4. Jira
5. Linear
6. Monday.com (coming soon)

Select a number (1, 2, 3, 4, 5, 6) [1]: 2

GitHub selected.

GitHub repository (e.g. user/repo): ytreister/gibr
Environment variable for your GitHub token [GITHUB_TOKEN]:
🎉  Found GitHub token in environment (GITHUB_TOKEN)
.gibrconfig already exists. Overwrite? [y/N]: y
✅  Created .gibrconfig with GitHub settings
You're all set! Try: `gibr issues`

alias

gibr includes a built-in helper that writes git aliases into your global ~/.gitconfig for you. Run:

gibr alias

This adds aliases such as git create so that instead of using the gibr CLI directly, you can use an extended version of git:

git create 123

The above command is equivalent to using the CLI as follows: gibr 123 or gibr create 123.

Flag order

The flag order when using the git alias version is different:

# ✅ gibr CLI (flags before)
gibr --verbose create 123

# ✅ git alias (flags after)
git create 123 --verbose

# ❌ wrong: flags after gibr CLI
gibr create 123 --verbose 

# ❌ wrong: flags before the alias
git --verbose create 123

issues

Run gibr issues (or git issues) to view open issues in the issue tracker you have configured

create

Run gibr 123 (or gibr create 123 or git create 123) to create a branch for the cooresponding issue number.

Branch naming convention

gibr uses the branch_name_format from your .gibrconfig to determine the format for the branch. You can use the following placeholders:

  • {issuetype}
  • {issue}
  • {title}
  • {assignee} (Note: If issue does not have an assignee and your branch name format contains assignee, you will not be able to create the branch)
Special case: Jira

For Jira, you can specify a project_key in your configuration:

[jira]
project_key=FOO

If you do this, you can choose to either specify the entire issue id or just the numerical portion (i.e. FOO-123 or 123

# List issues
$ gibr issues
| Issue   | Type    | Title       | Assignee   |
|---------|---------|-------------|------------|
| FOO-3   | Subtask | Subtask 2.1 | ytreister  |
| FOO-2   | Story   | Task 2      |            |
# Create branch for FOO-3
$ gibr 3
Generating branch name for issue FOO-3: Subtask 2.1
Branch name: FOO-3-subtask-2-1
✅  Created branch 'FOO-3-subtask-2-1' from main.
✅  Checked out branch: FOO-3-subtask-2-1
✅  Pushed branch 'FOO-3-subtask-2-1' to origin.
Special case: Azure

Azure DevOps allows teams to customize their work item states based on their workflow. By default, this integration assumes the following states represent closed/completed work items:

  • Done
  • Removed
  • Closed If your Azure DevOps project uses different state names or a custom workflow, you can configure the closed_states parameter to match your setup. [azure] closed_states: ['Done', 'Removed', 'Closed'] Work items matching any of the configured closed_states will be excluded from the list of active issues.

Optional flags

  • --verbose — enable debug-level logging for a command

Roadmap

See the Roadmap for upcoming features and plans.

Opensource contributions

See the Contributing guidelines if you would like to contribute.

💬 Feedback welcome!

Found a bug or have a feature request? Open an issue or start a discussion.
If you find it useful, consider starring ⭐️ the repo — it really helps visibility!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gibr-0.7.0.tar.gz (70.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gibr-0.7.0-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file gibr-0.7.0.tar.gz.

File metadata

  • Download URL: gibr-0.7.0.tar.gz
  • Upload date:
  • Size: 70.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for gibr-0.7.0.tar.gz
Algorithm Hash digest
SHA256 d96dfebe1b7d0d557dfc0c466fe3b429c7963d2014d4c7e0d4e59400c915d542
MD5 041a25ed78772c90c7902a9e488482ec
BLAKE2b-256 9624e36c9009ffc5bb2f97a77634f768bfbc1329d590a0e6e361bae3a50428ab

See more details on using hashes here.

File details

Details for the file gibr-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: gibr-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for gibr-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cb76bdb90de99064f8615804b229393ecf0da264dbfb4aa3d22fda55b161b7b
MD5 49be4b2584b3ad433ed196c4734965d2
BLAKE2b-256 ea764e74797af48692d847d63fac079377ce27455def0407edc20bc01848905b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page