annotate: display usage information if no filename was given
[git/git.git] / Documentation / git-branch.txt
CommitLineData
215a7ad1
JH
1git-branch(1)
2=============
7fc9d69f
JH
3
4NAME
5----
7bd7f280 6git-branch - Create a new branch, or remove an old one
7fc9d69f
JH
7
8SYNOPSIS
9--------
dd181119
JL
10[verse]
11'git-branch' [[-f] <branchname> [<start-point>]]
12'git-branch' (-d | -D) <branchname>
7fc9d69f
JH
13
14DESCRIPTION
15-----------
52a22d1e
LAS
16If no argument is provided, show available branches and mark current
17branch with star. Otherwise, create a new branch of name <branchname>.
52a22d1e
LAS
18If a starting point is also specified, that will be where the branch is
19created, otherwise it will be created at the current HEAD.
7fc9d69f 20
dd181119
JL
21With a `-d` or `-D` option, `<branchname>` will be deleted.
22
23
7fc9d69f
JH
24OPTIONS
25-------
d4072c97
AE
26-d::
27 Delete a branch. The branch must be fully merged.
28
29-D::
30 Delete a branch irrespective of its index status.
31
075dd8ee
FK
32-f::
33 Force a reset of <branchname> to <start-point> (or current head).
34
52a22d1e 35<branchname>::
d4072c97 36 The name of the branch to create or delete.
7fc9d69f 37
075dd8ee 38<start-point>::
d4072c97
AE
39 Where to create the branch; defaults to HEAD. This
40 option has no meaning with -d and -D.
7fc9d69f 41
1e2ccd3a
JH
42
43Examples
44~~~~~~~~
45
dd181119 46Start development off of a known tag::
1e2ccd3a
JH
47+
48------------
49$ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
50$ cd my2.6
51$ git branch my2.6.14 v2.6.14 <1>
52$ git checkout my2.6.14
53
54<1> These two steps are the same as "checkout -b my2.6.14 v2.6.14".
55------------
56
57Delete unneeded branch::
58+
59------------
60$ git clone git://git.kernel.org/.../git.git my.git
61$ cd my.git
62$ git branch -D todo <1>
63
64<1> delete todo branch even if the "master" branch does not have all
65commits from todo branch.
66------------
67
7fc9d69f
JH
68Author
69------
70Written by Linus Torvalds <torvalds@osdl.org> and Junio C Hamano <junkio@cox.net>
71
72Documentation
73--------------
74Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
75
76GIT
77---
a7154e91 78Part of the gitlink:git[7] suite
7fc9d69f 79