Last Updated: February 25, 2016
·
425
· migonzalvar

Open Bitbucket pull request web page from command line

Add this functions to your .bashrc

function pullrequest() {
    remote=$(command git remote -v | head -1 | sed "s/.*:\(.*\)\.git.*/\1/")
    if [[ -n ${remote} ]] ; then
        gnome-open https://bitbucket.org/$remote/pull-request/new > /dev/null 2> /dev/null
    else
        echo Not found remote
    fi
}

For Mac OS X you can substitute gnome-open with open.