Skip to content

Instantly share code, notes, and snippets.

@digarok
Created August 19, 2021 16:43
Show Gist options
  • Save digarok/3cbd9721eea68a17649649cf255a736c to your computer and use it in GitHub Desktop.
Save digarok/3cbd9721eea68a17649649cf255a736c to your computer and use it in GitHub Desktop.
gcleanup command
## gcleanup #####
# I used to have a one liner but it was janky so reverting to a full blown function by golly gosh gee.
# I like to show the branches if they don't specify one, but in oh_my_zsh they have some interactive thing
# you need to turn off like:
# $ git config --global pager.branch false
#
gcleanup_function() {
if [ -z $1 ] ; then echo "You must specify a branch to cleanup." ; git branch ; return -1; fi
git checkout master
git pull
git branch -d $1
}
alias gcleanup=gcleanup_function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment