Here are some bash aliases for git. Need to cull this list as well.
gclean is pretty handy if you hate having a ton of old branches locally. It lists all merged branches and deletes the local branches that have been merged.
# Git
alias ungit="find . -name '.git' -exec rm -rf {} \;"
alias gb='git branch'
alias gba='git branch -a'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gf='git fetch'
if [ $(uname) == "Darwin" ]; then
alias gcb="git branch | grep '^\*' | cut -d' ' -f2 | pbcopy"
fi
if [ $(uname) == "Linux" ]; then
alias gcb="git branch | grep '^\*' | cut -d' ' -f2 | xclip -sel c"
fi
# Commit pending changes and quote all args as message
function gg() {
git commit -v -a -m "$*"
}
alias gco='git checkout'
alias gcod='git checkout develop'
alias gcob='git checkout -b'
alias gd='git diff'
alias gdm='git diff master'
function gdx() {
git diff $1 $2 | gitx
}
alias gl='git pull'
alias gnp="git-notpushed"
alias gp='git push'
alias g='git status'
alias ga-modified="git status | grep modified | cut -d':' -f2 | xargs git add"
# Get and merge upstream repo
alias gups='git fetch upstream && git merge upstream/master'
alias eg='vim .git/config'
alias egg='vim ~/.gitconfig'
# Lists all merged branches and deletes the local branchs
alias gclean="git branch --merged | grep -v -i -E 'master|main|develop' | xargs -n 1 git branch -d"
gclean
is pretty handy if you hate having a ton of old branches locally. It lists all merged branches and deletes the local branches that have been merged.