1GIT-FEATURE(1) Git Extras GIT-FEATURE(1)
2
3
4
6 git-feature - Create/Merge feature branch
7
9 git-feature [-a|--alias PREFIX] [-s|--separator SEPARATOR] [-r|--remote
10 [REMOTE_NAME]] [--from START_POINT] NAME...
11
12 git-feature [-a|--alias PREFIX] [-s|--separator SEPARATOR] finish
13 [--squash] NAME...
14
16 Create or merge the given feature branch. The feature branch name is
17 made from the PREFIX, the SEPARATOR, and the NAME joined together.
18
19 The default PREFIX is feature and SEPARATOR is /, which can be changed
20 (see OPTIONS and GIT CONFIG for details).
21
22 The branch NAME may be specified as multiple words which will be joined
23 with -. If the branch name contains the word finish or is another OP‐
24 TION, -- should be passed to stop OPTION parsing. See the EXAMPLES for
25 details.
26
28 -a PREFIX, --alias PREFIX:
29
30 The branch prefix to use, or feature if not supplied.
31
32 -s SEPARATOR, --separator SEPARATOR:
33
34 The separator to use for joining the branch prefix and the
35 branch name, or / if not supplied.
36
37 -r [REMOTE_NAME], --remote [REMOTE_NAME]:
38
39 Setup a remote tracking branch using remote_name. If remote_name
40 is not supplied, use origin by default.
41
42 --from START_POINT:
43
44 Setup a start point when the branch created. If --from is not
45 supplied, use the current branch by default. This option will be
46 ignored when finishing a branch.
47
48 finish:
49
50 Merge and delete the feature branch.
51
52 --squash:
53
54 Run a squash merge when finishing the feature branch.
55
56 NAME:
57
58 The name of the feature branch.
59
61 You can configure the default branch prefix and separator via git con‐
62 fig options.
63
64 git-extras.feature.prefix:
65
66 $ git config --global add git-extras.feature.prefix "prefix"
67
68 git-extras.feature.separator:
69
70 $ git config --global add git-extras.feature.separator "-"
71
73 Start a new feature:
74
75 $ git feature dependencies
76 ...
77 $ (feature/dependencies) git commit -m "Some changes"
78
79 Finish a feature with --no-ff merge:
80
81 $ (feature/dependencies) git checkout master
82 $ git feature finish dependencies
83
84 Finish a feature with --squash merge:
85
86 $ (feature/dependencies) git checkout master
87 $ git feature finish --squash dependencies
88
89 Publish a feature upstream:
90
91 $ git feature dependencies -r upstream
92
93 Use custom branch prefix:
94
95 $ git alias features "feature -a features"
96 $ git features dependencies
97 $ (features/dependencies) ...
98 $ (features/dependencies) git checkout master
99 $ git features finish dependencies
100
101 Use custom branch separator:
102
103 $ git feature -s - dependencies
104 $ (feature-dependencies) ...
105 $ (feature-dependencies) git checkout master
106 $ git feature -s - finish dependencies
107
108 Use custom branch prefix and separator from git config with multiple
109 words:
110
111 $ git config --global --add git-extras.feature.prefix "features"
112 $ git config --global --add git-extras.feature.separator "."
113 $ git feature dependency tracking
114 $ (features.dependency-tracking) ...
115 $ (features.dependency-tracking) git checkout master
116 $ git feature finish dependency tracking
117
118 Use a git-feature option flag as part of a branch name:
119
120 $ git feature -- finish remote
121 ...
122 $ (feature/finish-remote) git commit -m "Some changes"
123
125 Written by Jesús Espino <jespinog@gmail.com>
126 Modified by Mark Pitman <mark.pitman@gmail.com>
127 Modified by Carlos Prado <carlos.prado@cpradog.com>
128 Modified by Austin Ziegler <halostatue@gmail.com>
129
131 <https://github.com/tj/git-extras/issues>
132
134 <https://github.com/tj/git-extras>, git-create-branch(1),
135 git-delete-branch(1)
136
137
138
139 September 2023 GIT-FEATURE(1)