Skip to content

Commit bb35f35

Browse files
jrngitster
authored andcommitted
Documentation: clarify branch creation
The documentation seems to assume that the starting point for a new branch is the tip of an existing (ordinary) branch, but that is not the most common case. More often, "git branch" is used to begin a branch from a remote-tracking branch, a tag, or an interesting commit (e.g. origin/pu^2). Clarify the language so it can apply to these cases. Thanks to Sean Estabrooks for the wording. Also add a pointer to the user's manual for the bewildered. Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 58d2c96 commit bb35f35

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Documentation/git-branch.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ commit) will be listed. With `--no-merged` only branches not merged into
3030
the named commit will be listed. If the <commit> argument is missing it
3131
defaults to 'HEAD' (i.e. the tip of the current branch).
3232

33-
In the command's second form, a new branch named <branchname> will be created.
34-
It will start out with a head equal to the one given as <start-point>.
35-
If no <start-point> is given, the branch will be created with a head
36-
equal to that of the currently checked out branch.
33+
The command's second form creates a new branch head named <branchname>
34+
which points to the current 'HEAD', or <start-point> if given.
3735

3836
Note that this will create the new branch, but it will not switch the
3937
working tree to it; use "git checkout <newbranch>" to switch to the
@@ -149,9 +147,9 @@ start-point is either a local or remote branch.
149147
may restrict the characters allowed in a branch name.
150148

151149
<start-point>::
152-
The new branch will be created with a HEAD equal to this. It may
153-
be given as a branch name, a commit-id, or a tag. If this option
154-
is omitted, the current branch is assumed.
150+
The new branch head will point to this commit. It may be
151+
given as a branch name, a commit-id, or a tag. If this
152+
option is omitted, the current HEAD will be used instead.
155153

156154
<oldbranch>::
157155
The name of an existing branch to rename.
@@ -216,7 +214,9 @@ SEE ALSO
216214
--------
217215
linkgit:git-check-ref-format[1],
218216
linkgit:git-fetch[1],
219-
linkgit:git-remote[1].
217+
linkgit:git-remote[1],
218+
link:user-manual.html#what-is-a-branch[``Understanding history: What is
219+
a branch?''] in the Git User's Manual.
220220

221221
Author
222222
------

0 commit comments

Comments
 (0)