Written in Go... Logo authored by Midjourney
go-branchy
or branchy
is a CLI helper which generates/creates git branch
names from JIRA tickets (summary field) and automatically copies the branch name
to the clipboard.
This project has two motivational aspects. The first is that we use a common pattern to create git branch names at work (and we use JIRA... of course). So this is why I created a little tool to create a branch name by just giving the branch type (e.g. feat or fix) and a JIRA issue (e.g. ABC-1234). The result should be the following:
feat/ABC-1234/super-cool-branch-name-created-from-a-jira-summary
The second aspect is the learning aspect. This little tool and the whole repository seem to be a little overloaded for what it really achieves. But I had different goals on what I wanted to learn. These where the things I wanted to learn or at least try out:
- Building a CLI tool with Cobra
- Using Task instead of a
Makefile
- Automating the release process with GoReleaser and GitHub Actions
- Generating the
CHANGELOG.md
automatically with git-chglog - Generating a beautiful logo with
ChatGPT
andMidjourney
- And of course also utilizing
GitHub Copilot
go install github.com/untcha/go-branchy@latest
You can download the binary from the GitHub releases page and add it to your $PATH
The go-branchy_<version>_checksums.txt
file contains the SHA-256 checksum for each file.
In order to use go-branchy
you need to export the following two environment
variables:
export BRANCHY_JIRA_URL=<the-url-of-your-jira-instance>
export BRANCHY_JIRA_TOKEN=<your-jira-personal-access-token>
Now you can use branchy
very simple:
go-branchy generate feat ABC-1234
or use the alias g
instead of generate:
go-branchy g feat ABC-1234
go-branchy help
A little helper tool to create git branch names from JIRA tickets - written in Go
Branchy is a CLI helper which generates/creates git branch names from JIRA tickets (summary field)
and automatically copies the branch name to the clipboard (e.g. feat/ABC-1234/this-is-my-branch-name)
Usage:
go-branchy [command]
Examples:
go-branchy generate feat ABC-1234
go-branchy g fix ABC-1234
Available Commands:
completion Generate the autocompletion script for the specified shell
generate Generate a branch name from a JIRA issue summary field
help Help about any command
version Print the CLI version
Flags:
-h, --help help for branchy
Use "go-branchy [command] --help" for more information about a command.