Added a track command to git-flow-hotfix along the lines of the git-flow-feature track command
diff --git a/git-flow-hotfix b/git-flow-hotfix
index b355f30..4ea87fc 100644
--- a/git-flow-hotfix
+++ b/git-flow-hotfix
@@ -47,6 +47,7 @@
echo " git flow hotfix start [-F] <version> [<base>]"
echo " git flow hotfix finish [-Fsumpk] <version>"
echo " git flow hotfix publish <version>"
+ echo " git flow hotfix track <version>"
}
cmd_default() {
@@ -216,6 +217,26 @@
echo
}
+cmd_track() {
+ parse_args "$@"
+ require_version_arg
+
+ # sanity checks
+ require_clean_working_tree
+ require_branch_absent "$BRANCH"
+ git fetch -q "$ORIGIN"
+ require_branch "$ORIGIN/$BRANCH"
+
+ # create tracking branch
+ git checkout -b "$BRANCH" "$ORIGIN/$BRANCH"
+
+ echo
+ echo "Summary of actions:"
+ echo "- A new remote tracking branch '$BRANCH' was created"
+ echo "- You are now on branch '$BRANCH'"
+ echo
+}
+
cmd_finish() {
DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
DEFINE_boolean sign false "sign the release tag cryptographically" s