macOS xterm-256color zsh 273 views

Installing

  • Install ipt with npm: npm i -g ipt
  • open git config file: git config --global -e
  • paste this (merge with your current alias, if needed):
[alias]
    ChooseLocalBranch = !git branch | (grep -v \"*\" > /dev/null) && (git branch | grep -v \"*\" | ipt -M \"Choose a local branch$EXTRA_MESSAGE:\" -a)
    SelectLocalBranches = !git branch | (grep -v \"*\" > /dev/null) && (git branch | grep -v \"*\" | ipt -M \"Select local branches$EXTRA_MESSAGE:\" -am)
    ChooseRemoteBranch = !git branch -r | (grep -v "HEAD" > /dev/null) && (git branch -r | grep -v "HEAD" | sed \"s/origin\\///g\" | ipt -M \"Choose a remote branch$EXTRA_MESSAGE:\" -a)
    SelectRemoteBranches = !git branch -r | (grep -v "HEAD" > /dev/null) && (git branch -r | grep -v "HEAD" | sed \"s/origin\\///g\" | ipt -M \"Select remote branches$EXTRA_MESSAGE:\" -am)
    db = !EXTRA_MESSAGE=\" to delete\" git SelectLocalBranches | xargs git branch -d
    col = !EXTRA_MESSAGE=\" to checkout\" git ChooseLocalBranch | xargs git checkout
    cor = !EXTRA_MESSAGE=\" to checkout\" git ChooseRemoteBranch | xargs git checkout

Using

  • Checkout Local Branch (col):

    • git col
    • choose a branch
    • press enter
  • Checkout Remote Branch (cor):

    • git cor
    • choose a branch
    • press enter
  • Delete Branches (db):

    • git db
    • use space to select branches
    • press enter

More recordings by rjmunhoz

Browse all

Doctor rebuild 0:05

by rjmunhoz

Doctor reduce 0:04

by rjmunhoz

Doctor help 0:02

by rjmunhoz

Doctor diff 0:01

by rjmunhoz