Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
close-pull-request.sh
#!/usr/bin/env bash
gitclosepullrequest () {
local status branch
status="$(git status 2>/dev/null)"
[[ $? != 0 ]] && return;
branch="$(git branch | perl -ne '/^\* (.*)/ && print $1')"
git fetch origin master:master && git checkout master && git branch -d ${branch}
}
gitclosepullrequest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment