Created
October 9, 2012 21:21
-
-
Save evgeny-goldin/3861542 to your computer and use it in GitHub Desktop.
Git aliases
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 grw='clear && ./gradlew -S $*' | |
alias pack='tar -czf' | |
alias gc='git checkout $*' | |
alias gs='git status' | |
alias gw='git whatchanged $*' | |
alias gl='git log --format=format:[%h]-[%cn]-[%cr]-[%s] -10 $*' | |
# Git backup | |
alias gitb='gitgc && rm -f ~/Dropbox/Backup/projects/${PWD##*/}.tar.gz && pack ~/Dropbox/Backup/projects/${PWD##*/}.tar.gz -X ~/git-backup-exclude.txt .' | |
alias gitbg='grw clean && gitb' | |
alias gitbm='mvn clean && gitb' | |
# Git GC | |
function gitgc() { | |
rm -rf .git/hooks | |
git stash clear | |
git reflog expire --expire=1.minute refs/heads/master | |
git fsck --unreachable --strict | |
git prune -v | |
git gc | |
} | |
# Enhanced "git log" | |
function gll() { | |
cls | |
git --no-pager log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative -10 $1 | |
echo | |
} | |
# "git fetch" + enhanced "git log" | |
function ggll() { | |
cls | |
git fetch | |
gll | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment