Created
December 5, 2023 00:54
-
-
Save RohanM/2f960caf38c6baf614ce4e9810703135 to your computer and use it in GitHub Desktop.
Aliases for git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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