Aliases (Linux Shell)

  1. Introduction
    1. Aliases

Introduction

These are some aliases that I have cobbled together.

Aliases

Copy these into a file, for example ~/.sh_aliases.

alias l="ls -alh"

# Git related aliases
alias gits="git status"
alias gita="git add"
alias gitaa="git add -A"
alias gitc="git commit"
alias gitf="git fetch"
alias gitl="git log --graph \
--pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' \
--abbrev-commit"
alias gitlg="git log --graph \
--abbrev-commit --decorate \
--format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' \
--all"
alias gitlga="git log --graph \
--abbrev-commit --decorate \
--format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)' \
--all"

These may then be sourced within your ~/.*rc file (e.g. ~/.bashrc or ~/.zshrc)

if [ -f ~/.sh_aliases ]; then
. ~/.sh_aliases
fi