Last active
June 27, 2019 12:15
-
-
Save rymcol/2d46584c4c6ac42a9bee58cf93da275e to your computer and use it in GitHub Desktop.
When on a feature branch that has been merged remotely, type `merged [base_branch]` to checkout that base, update it, and delete the feature branch
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
| function merged | |
| set branch (git branch | grep \* | cut -d ' ' -f2) | |
| if count $argv > /dev/null | |
| set base $argv[1] | |
| else | |
| echo "You must provide the base branch as an argument… `merged [base]`" | |
| return 2 | |
| end | |
| if [ $branch != $base ] | |
| git checkout $base; and git pull origin $base; and git branch -d $branch; | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment