Skip to main content

Johan Bové

Git aliases

1 min read

As a developer I use Git all the time and since I also spend a lot of time in terminals, and modern terminals have the option to create aliases for commands, I have these Git command aliases to speed up my workflow:

# Checks the git log for commits with a signature and very the found PGP keys with keys looked up
#   in
# See
alias gitpgp='git log --show-signature | grep "RSA key" | grep -o "[A-Z0-9]\+$" | sort | uniq | xargs gpg --keyserver --recv-keys $keys'

alias gc='git checkout'
alias gf='git fetch'
alias gs='git status'
alias gl='git log --oneline'
alias gp='git pull'
# Will give you a list of branches sorted by committer date
alias gbl='git for-each-ref --sort=committerdate refs/heads/ --format="%(color:red)%(committerdate:short) %(color:cyan)%(refname:short)"'
alias gh='git rev-parse --verify --short HEAD'

, , ,