Github Compare Branch
function branch_name() {
branch_name="$(git symbolic-ref HEAD 2>/dev/null)"
branch_name=${branch_name##refs/heads/}
echo $branch_name
}
function gh_compare() {
branch_name=`branch_name`
repo=`git remote -v | grep push | grep origin | awk '{print $2}' | sed -e "s/^.*:\(.*\).git$/\1/"`
url=https://github.com/$repo/compare/stable...$branch_name
open -a "/Applications/Google Chrome.app" "$url";
}
// Open the compare view in GitHub of your current branch against the stable branch
$ gh_compare
Written by Paco Guzmán
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#