Created
July 14, 2017 09:42
-
-
Save dariobanfi/96ed2bb5ffda196c63b55cb0db6d4cfe to your computer and use it in GitHub Desktop.
OsX bash function to open pull requests for GitHub Enterprise accounts
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
function makepr() { | |
giturl='github.enterprise.url' | |
branch=`git rev-parse --abbrev-ref HEAD` | |
remote=`git remote get-url origin` | |
if [[ $remote == https* ]]; then | |
project=$(echo $remote | sed -e "s/.*$giturl\/\(.*\).git.*/\1/") | |
else | |
project=$(echo $remote | sed 's%^.*:\([^:]*\)\.git$%\1%g') | |
fi | |
open "https://$giturl/$project/compare/$branch?expand=1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment