Last active
June 12, 2020 10:42
-
-
Save pevers/4d99d3a82a4987c970db75a6f6bdb9db to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) | |
REPO=$(git remote get-url origin | sed -n 's/^.*:\(.*\).git$/\1/p') | |
TARGET_BRANCH=${1:-${GH_BRANCH:-staging}} | |
LINK="https://github.com/$REPO/compare/$TARGET_BRANCH...$BRANCH_NAME" | |
if [ -x "$(command -v xdg-open)" ]; then | |
xdg-open $LINK | |
exit 0 | |
fi | |
open $LINK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.zshrc
/.bashrc
/.bash_profile