1GIT-CREATE-BRANCH(1) Git Extras GIT-CREATE-BRANCH(1)
2
3
4
6 git-create-branch - Create branches
7
9 git-create-branch [-r|--remote [remote_name]] <branchname>
10
12 Creates local branch named <branchname> and optionally sets up a remote
13 tracking branch.
14
16 <-r|--remote [remote_name]>
17
18 Setup a remote tracking branch using remote_name. If remote_name is not
19 supplied, use origin by default.
20
21 <branchname>
22
23 The name of the branch to create.
24
26 You may save your default preference for the remote option above by
27 using git config with the key git-extras.create-branch.remote whose
28 value will be the default remote when [-r|--remote] is not specified.
29
30
31
32 $ git config git-extras.create-branch.remote lucinda
33
34
35
36 The command line option -r|--remote will override this preference.
37
39 With no remote preference set:
40
41
42
43 # creates local branch ´integration´
44 $ git create-branch integration
45
46 # creates local & remote branch ´integration´ (on default ´origin´)
47 $ git create-branch -r integration
48
49 # creates local & remote branch ´integration´ on ´upstream´
50 $ git create-branch -r upstream integration
51
52
53
54 With git-extras.create-branch.remote preference set to ´lucinda´:
55
56
57
58 # creates local & remote branch ´integration´ (on preference ´lucinda´)
59 $ git create-branch integration
60
61 # overriding preference, using default `-r` of ´origin´
62 # creates local & remote branch ´integration´ on default ´origin´
63 $ git create-branch -r integration
64
65 # overriding preference, using specified `-r` of ´upstream´
66 # creates local & remote branch ´integration´ on ´upstream´
67 $ git create-branch -r upstream integration
68
69
70
72 · As of 4.4.0, the default behavior has changed. git-create-branch
73 will no longer automatically setup a remote tracking branch unless
74 the -r|-remote option is specified. See additional note on prefer‐
75 ence feature in 4.8.0-dev below.
76
77 · As of 4.8.0-dev, the remote option can be set via git config pref‐
78 erence as described in Preferences section.
79
80
81
83 Written by Jonhnny Weslley <jw@jonhnnyweslley.net> Modified by Mark
84 Pitman <mark.pitman@gmail.com>, Brian Murrell <btmurrell@gmail.com>.
85
87 <https://github.com/tj/git-extras/issues>
88
90 <https://github.com/tj/git-extras>
91
92
93
94 June 2019 GIT-CREATE-BRANCH(1)