#git-branch #branch #ticket #git #git-flow #ticket-number

bin+lib branchify

Format a ticket number and summary into a Git branch name

1 unstable release

0.1.0 Apr 27, 2022

#1371 in Development tools

MIT license

9KB
200 lines

Tests Passing

branchify

Git branch name helper written in Rust.

Usage

Pass a ticket number and summary separated by a tab character via stdin and receive a feature branch name.

# command
echo "FOO-123\tThis is a ticket" | branchify

#output
feature/FOO-123-this-is-a-ticket

Specifying a branch type

# command
echo "FOO-123\tThis is a ticket" | branchify -t hotfix

#output
hotfix/FOO-123-this-is-a-ticket

With a prefix before the branch type

# command
echo "FOO-123\tThis is a ticket" | branchify -p adam

#output
adam/feature/FOO-123-this-is-a-ticket

The branch name will also be truncated to 40 characters

# command
echo "FOO-123\tThis ticket has a longer name"| branchify

#output
feature/FOO-123-this-ticket-has-a-longer

Used in conjunction with jira-cli and fzf

# command
git checkout -b $(jira issue list --plain --columns key, summary | fzf | branchify)

Dependencies

~2.1–3MB
~53K SLoC