DEV Community

loading...

Discussion on: Your favorite `git` aliases?

Collapse
ryanmaynard profile image
Ryan Maynard

Here are mine:


alias gb='git branch'
alias gs='git status'
alias ga='git add'
alias gc='git commit'
alias gl='git log'
alias glo='git log --pretty=oneline'
alias glu="git log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
alias glg="git log --decorate --graph --abbrev-commit --date=relative"
alias gh='git checkout'
alias gt='git tag'
alias grs='git reset'
alias grv='git revert'
alias gm='git merge'
alias gd='git diff'
alias gp='git push'
alias gpo='git push origin'
alias gob='git checkout -b'
alias gh='cat .git/HEAD'
alias grgu='git remote get-url'

alias gbb="git for-each-ref --sort=-committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"
alias gbbb="git for-each-ref --sort=-committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"