Skip to content

jakub-m/git-linear-branch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-linear-branch

A simple helper to speed up creating git new branch names from git branches from Linear. The tool remembers the last Linear-like branch prefix for a directory.

Installation

make release

Then make the git-linear-branch accessible from $PATH.

To plug git-linear-branch to zsh use the following _fzf_comprun:

export FZF_COMPLETION_TRIGGER='`'

_fzf_comprun() {
  local command=$1
  shift

  case "$command" in
    git-linear-branch)
                  git-linear-branch \
                      | fzf \
                        --with-nth 2.. \
                        --bind 'ctrl-d:reload(git-linear-branch --delete-prefix {1} && git-linear-branch)' \
                      | cut -f1

                  ;;
  esac
}

Usage

The tool keeps last 3 prefixes.

List all the prefixes:

git-linear-branch `<tab>

Create a branch with selected prefix:

git-linear-branch foo/bar-123 hello world

Create a branch from a full branch name (copied from Linear)

git-linear-branch foo/bar-123-hello-world

Create branch with the last prefix selected implicitly:

git-linear-branch hello world

Delete prefix from storage:

git-linear-branch --delete-prefix foo/bar-123

About

A tiny tool to speed up creating branches with Linear prefixes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published