diff --git a/git-open-in-github b/git-open-in-github new file mode 100755 index 0000000..843edd9 --- /dev/null +++ b/git-open-in-github @@ -0,0 +1,10 @@ +#!/bin/sh + +REMOTE="${1:-origin}" +BRANCH="${2:-$(git rev-parse --abbrev-ref HEAD)}" +REPO=$(git config --get remote.${REMOTE}.url | cut -d':' -f2 | cut -d'.' -f1) +if [[ -z "$REPO" ]] || [[ -z "$BRANCH" ]]; then + echo "usage: $(basename "$0") " + exit 1 +fi +open "https://github.com/${REPO}/compare/${BRANCH}?expand=1" diff --git a/git-push-feature-branch b/git-push-feature-branch new file mode 100755 index 0000000..01f2926 --- /dev/null +++ b/git-push-feature-branch @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e # bail on errors + +REMOTE="${1:-origin}" +BRANCH="${2:-$(git rev-parse --abbrev-ref HEAD)}" + +git update "$REMOTE" develop +git checkout develop +git merge --no-ff "$BRANCH" +git push +git checkout "$BRANCH" +git push -u "$REMOTE" "$BRANCH"