Skip to content

re: How I Set Up Git Aliases on Bash VIEW POST


I use one or two letters aliases for the most used commands:

alias g='git'
alias k='kubectl'
alias d='docker'
alias t='terraform'
alias be='bundle exec'
alias s='summon'

and then Git aliases in ~/.gitconfig:

    since = !git log $(git merge-base --fork-point master)..HEAD
    t = tag -s
    please = push --force-with-lease
    commend = commit --amend --no-edit
    pr = !"pr() { git fetch origin pull/$1/head:pr-$1; }; pr"
    branches = !"git for-each-ref --sort='-authordate:iso8601' --format=' %(color:green)%(authordate:iso8601)%09%(color:white)%(refname:short)' refs/heads"

As a result, most of my work in feature branches is a series of:

  • g commend
  • g please

until I'm happy with a PR 😁

code of conduct - report abuse