Skip to content

Instantly share code, notes, and snippets.

@matheusfaustino
Created November 18, 2016 12:20
Show Gist options
  • Save matheusfaustino/8fdc1832cd30c378c2104bb2dab7907b to your computer and use it in GitHub Desktop.
Save matheusfaustino/8fdc1832cd30c378c2104bb2dab7907b to your computer and use it in GitHub Desktop.
git alias
#
# Git alias
#
alias changesgit="git diff --name-status -r"
alias gdiff="git diff --stat -r"
alias ghead="git show -s --pretty='tformat:%h, %s, %ad' --date=short"
alias gl="git log --color --graph --pretty=format:'%Credbold%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gb="git branch -v"
alias g="git status -sb"
alias gc="git commit"
alias ga="git add"
alias gpl="git pull"
alias gps="git push"
alias changesgit="git diff --name-status -r"
alias rank="shortlog -sn --no-merges"
#Use it with the command. eg: git co
alias co="checkout"; # Checkout a branch
alias cob="git checkout -b"; # Checkout a new not yet existing branch
alias cor="git checkout -"; # Go back to the last branch
alias gba="git branch -a"; # List both remote-tracking branches and local branches.
alias gbd="git branch -d"; # Delete a branch only if it has been merged
alias gdc="git diff --cached"; # Display the staged changes
alias gap="git add -p"; # See the changes before adding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment