Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 59 lines (50 sloc) 1.27 kb
00ccea6 @hollow refactor the whole thing
hollow authored
1 #
6c2d30b @nvie Structurally replace gitflow by git-flow, as a true git extension.
authored
2 # git-flow -- A collection of Git extensions to provide high-level
3 # repository operations for Vincent Driessen's branching model.
00ccea6 @hollow refactor the whole thing
hollow authored
4 #
5 # Original blog post presenting this model is found at:
6 # http://nvie.com/archives/323
7 #
8 # Feel free to contribute to this project at:
9 # http://github.com/nvie/gitflow
10 #
11 # Copyright (c) 2010 by Vincent Driessen
12 # Copyright (c) 2010 by Benedikt Böhm
13 #
14
15 usage() {
16 echo "usage: git flow start support <version> [<base>]"
17 }
18
19 parse_args() {
20 VERSION="$1"
21 BASE="${2:-v${VERSION}}"
22 if [ "$VERSION" = "" ]; then
23 echo "Missing argument <version>."
24 usage
25 exit 1
26 fi
96f44c0 @hollow make branch prefixes configurable
hollow authored
27 PREFIX=$(git config --get gitflow.prefix.support || echo support/)
28 BRANCH=$PREFIX$VERSION
00ccea6 @hollow refactor the whole thing
hollow authored
29 }
30
31 cmd_help() {
32 usage
33 exit 0
34 }
35
36 cmd_start() {
37 parse_args "$@"
38
39 # sanity checks
40 gitflow_check_clean_working_tree
41
42 # create branch
43 git checkout -b $BRANCH $BASE
44
45 # publish branch
350e715 @hollow make origin configurable
hollow authored
46 git push $ORIGIN $BRANCH:refs/heads/$BRANCH
4d22227 @hollow make git fetch silent
hollow authored
47 git fetch -q $ORIGIN
350e715 @hollow make origin configurable
hollow authored
48 git config branch.$BRANCH.remote $ORIGIN
00ccea6 @hollow refactor the whole thing
hollow authored
49 git config branch.$BRANCH.merge refs/heads/$BRANCH
50 git co $BRANCH
51
52 echo
53 echo "Summary of actions:"
54 echo "- A new remote branch '$BRANCH' was created, based on '$BASE'"
55 echo "- A new tracking branch '$BRANCH' was created"
56 echo "- You are now on branch '$BRANCH'"
57 echo
58 }
Something went wrong with that request. Please try again.