Created
May 4, 2015 17:26
-
-
Save halfvector/e2b064b1c58d59e80547 to your computer and use it in GitHub Desktop.
Git aliases
This file contains hidden or 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
# a few git commands | |
alias gs='git status' | |
alias gp='git push' | |
alias gl='git log --graph --pretty=tformat:"%C(auto)%h%Creset - %s %Cgreen(%cr) %C(bold blue)<%an>%Creset %C(auto)%d%Creset" --abbrev-commit' | |
alias cdiff='cdiff -s -c always | less -rFX' | |
# recent log entries without a pager | |
alias glr='git --no-pager log -25 --graph --pretty=tformat:"%C(auto)%h%Creset - %s %Cgreen(%cr) %C(bold blue)<%an>%Creset %C(auto)%d%Creset" --abbrev-commit' | |
alias gs='git status -s' | |
alias gup='git pull --rebase' | |
alias gb='git branch -v -v' | |
alias gds='git diff --stat' | |
alias ga='git add . -A' | |
# pretty diffs (requires cdiff) | |
# unstagged && uncommitted | |
alias gd='echo "Showing unstagged and uncommitted changes:"; cdiff' | |
# stagged && uncommitted | |
alias gds='echo "Showing stagged but uncommitted changes:"; git diff -C -M --cached | cdiff' | |
# stagged && committed | |
alias gdc='echo "Showing committed changes:"; git diff origin..HEAD | cdiff' | |
# stagged || unstagged || committed || uncommitted | |
alias gdp='echo "Showing all unpushed changes:"; git diff -C -M HEAD~1 | cdiff' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment