Skip to content

Instantly share code, notes, and snippets.

@thienanle
thienanle / pull_request.sh
Last active April 27, 2017 01:30 — forked from devongovett/pull_request.sh
Bash script to make a pull request from the current git repository. Tries the upstream remote if possible, otherwise uses origin.
# put this in your .bash_profile
pull_request() {
to_branch=$1
if [ -z $to_branch ]; then
to_branch="master"
fi
# try the upstream branch if possible, otherwise origin will do
# exit if there is no origin
upstream=$(git config --get remote.upstream.url)