Created
May 4, 2020 20:56
-
-
Save reverie/4fd9fbb6b5c6c1953ee20dc52d8d5864 to your computer and use it in GitHub Desktop.
Git bash helpers
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
function c { git checkout $@; } | |
function b { git branch $@; } | |
alias s="git status" | |
alias d="git diff" | |
alias dc="git diff --cached" | |
alias dv="git diff | vim -" | |
alias l="git log" | |
alias gp="git pull" | |
alias gpu="git push" | |
alias cam="git commit -am" | |
alias delete-merged-local-branches="git branch --merged | grep -v master | grep -v staging | xargs git branch -d" | |
alias delete-merged-remote-branches="git branch -r --merged | grep -v master | grep -v staging | grep origin | sed 's/origin\///' | xargs -n 1 git push --delete origin" | |
function delete-branches-matching { git branch | grep "$@" | xargs git branch -D; } | |
alias gpickaxe="git log -p -S" | |
alias gcleanup="c master && gp && delete-merged-local-branches && git remote prune origin && delete-merged-remote-branches" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment