/
gitflow
69 lines (60 loc) · 1.14 KB
/
gitflow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# gitflow简化版指令集
# 比如git flow feature start <name>,可以换成脚本执行./gitflow -fs <name>。
type=""
# start publish finish
action=""
# branch
branch="$2"
while [ -n "$1" ]; do # while loop starts
case "$1" in
-a) echo "-a option passed" ;;
# feature all
-fs)
type="feature"
action="start"
shift
;;
-fp)
type="feature"
action="publish"
shift
;;
-ff)
type="feature"
action="finish"
shift
;;
# feature all
-rs)
type="release"
action="start"
shift
;;
-rp)
type="release"
action="publish"
shift
;;
-rf)
type="release"
action="finish"
shift
;;
-hs)
type="hotfix"
action="start"
shift
;;
-hf)
type="hotfix"
action="finish"
shift
;;
# release all
*) echo "Option $1 not recognized" ;;
esac
shift
done
echo "git flow preparing action:$action type: $type branch $branch"
git flow $type $action $branch