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