Skip to content

Instantly share code, notes, and snippets.

@RohanM
Created December 5, 2023 00:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RohanM/2f960caf38c6baf614ce4e9810703135 to your computer and use it in GitHub Desktop.
Save RohanM/2f960caf38c6baf614ce4e9810703135 to your computer and use it in GitHub Desktop.
Aliases for git
alias gs='git status'
alias gd='git diff'
alias gdc='git diff --cached'
alias gds='git diff --stat=160,160'
alias gdcs='git diff --cached --stat=160,160'
alias gl='git log --graph --pretty="format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset" -10'
alias gls='gl'
alias gll='git log --graph --pretty="format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset"'
alias gld='git log --graph --pretty="format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ad%Creset"'
alias gb='git branch --sort=committerdate'
alias gbmd='git branch --merged |grep -v main |xargs git branch -d'
alias ga='git add'
alias gap='git add --patch'
alias grh='git reset HEAD'
alias gc='git commit'
alias gcwip='git commit --no-verify -m "WIP"'
alias gco='git checkout'
alias gcom='git checkout main'
alias gcop='git checkout -'
alias gp='git push'
alias gg='git grep'
alias gri='git rebase -i'
alias grim='git rebase -i main'
alias grid='git rebase -i develop'
alias grc='git rebase --continue'
alias gra='git rebase --abort'
alias gcpc='git cherry-pick --continue'
alias gssp='git stash show -p'
alias gsh='git show HEAD'
alias gprc='git push -u && gh pr create -d'
alias gu='git up && gbmd'
gt() { git checkout -b `echo $1 |sed "s/\(.*\)\/\([^\/]*\)$/\2/"`; } # read trello link and create branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment