Last active
August 29, 2015 14:00
-
-
Save pitr/8242ac5253a72ddf3838 to your computer and use it in GitHub Desktop.
gbr - Open PR with current branch in bitbucket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gbr() { | |
originurl=$(git config --get remote.origin.url | tr '[:upper:]' '[:lower:]') | |
originurl=${originurl/git\@bitbucket\.org\:/https://bitbucket.org/} | |
originurl=${originurl/\git:/https:} | |
originurl=${originurl/\.git/} | |
path=$(git config --get remote.origin.url | tr '[:upper:]' '[:lower:]' | sed -e 's/[email protected]://') | |
branchName=$(git rev-parse --abbrev-ref HEAD) | |
giturl=$originurl"/pull-request/new?source="$path"::"$branchName | |
open $giturl | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment