Skip to content

Instantly share code, notes, and snippets.

@VovanR
Created June 24, 2019 13:01
Show Gist options
  • Save VovanR/ab877bfe6b058da9f05710377f24517f to your computer and use it in GitHub Desktop.
Save VovanR/ab877bfe6b058da9f05710377f24517f to your computer and use it in GitHub Desktop.
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