Skip to content

Instantly share code, notes, and snippets.

@rymcol
Last active June 27, 2019 12:15
Show Gist options
  • Save rymcol/2d46584c4c6ac42a9bee58cf93da275e to your computer and use it in GitHub Desktop.
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
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