Created
August 19, 2021 16:43
-
-
Save digarok/3cbd9721eea68a17649649cf255a736c to your computer and use it in GitHub Desktop.
gcleanup command
This file contains hidden or 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
## 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