New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Allow merge
to delete branches locally and remotely
#1587
Comments
Thanks for suggesting! It's a good idea. Let me think about this for a while and see if we can incorporate this into the roadmap. Do you imagine this to be an extra, optional flag to |
This could be a flag for If we mimic how |
+1 @lunks how do you merge PRs from the CLI at the moment? Is there any way to merge PRs from CLI/hub that creates the same message like the one when doing merge through web UI. For example:
Ah, seems like this does the job |
If hub provided a command to get the branch name for a given pull request URL, we might be able to build this easily in user land. |
With the addition of hub pr list -f "%i %H%n" | grep $PR_NUMBER | cut -d ' ' -f 2 Given a PR number, this will return the branch name. So altogether, it would be possible to do this: # Store branch name before it gets merged
BRANCH=`hub pr list -f "%U %H%n" | grep $PR_NUMBER_OR_URL | cut -d ' ' -f 2`
# Merge to base (assumed to be master) and push
git checkout master
hub merge $PR_URL
git push
# Delete local/remote branch
git branch -D $BRANCH
git push origin :$BRANCH |
On my current flow it'd be ideal if I had the option of deleting both remote and local branches when I merge a PR.
I could script it, but the way
hub
works when merging is using an URL which I don't have the branch name at hand.The text was updated successfully, but these errors were encountered: