-
-
Save hodgestar/b0292ae8670834499d37 to your computer and use it in GitHub Desktop.
Git Flow Feature helper script.
This file contains hidden or 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 | |
CMD="$1" | |
shift 1 | |
function get_feature () { | |
FEATURE=`git flow feature | grep '^\* ' | sed 's/^\* //'` | |
ISSUE=`echo "$FEATURE" | sed -e 's/issue-\([0-9]*\)-.*/\1/'` | |
echo "Feature: $FEATURE (issue: $ISSUE)" | |
} | |
case "$CMD" in | |
"") | |
git flow feature | |
;; | |
start) | |
git flow feature "$CMD" "$@" | |
;; | |
track) | |
git flow feature "$CMD" "$@" | |
;; | |
finish|publish|diff|checkout|pull) | |
get_feature | |
git flow feature "$CMD" "$FEATURE" | |
;; | |
pr) | |
get_feature | |
git flow feature publish "$FEATURE" && hub pull-request -i "$ISSUE" -b develop | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment