Document git-ls-files --directory
[git/dscho.git] / Documentation / git-branch.txt
blobd20b4757358d7927f114de4a816e912ba67553fc
1 git-branch(1)
2 =============
4 NAME
5 ----
6 git-branch - Create a new branch, or remove an old one.
8 SYNOPSIS
9 --------
10 'git-branch' [-d | -D] [<branchname> [start-point]]
12 DESCRIPTION
13 -----------
14 If no argument is provided, show available branches and mark current
15 branch with star. Otherwise, create a new branch of name <branchname>.
17 If a starting point is also specified, that will be where the branch is
18 created, otherwise it will be created at the current HEAD.
20 OPTIONS
21 -------
22 -d::
23         Delete a branch. The branch must be fully merged.
25 -D::
26         Delete a branch irrespective of its index status.
28 <branchname>::
29         The name of the branch to create or delete.
31 start-point::
32         Where to create the branch; defaults to HEAD. This
33         option has no meaning with -d and -D.
36 Examples
37 ~~~~~~~~
39 Start development off of a know tag::
41 ------------
42 $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
43 $ cd my2.6
44 $ git branch my2.6.14 v2.6.14 <1>
45 $ git checkout my2.6.14
47 <1> These two steps are the same as "checkout -b my2.6.14 v2.6.14".
48 ------------
50 Delete unneeded branch::
52 ------------
53 $ git clone git://git.kernel.org/.../git.git my.git
54 $ cd my.git
55 $ git branch -D todo <1>
57 <1> delete todo branch even if the "master" branch does not have all
58 commits from todo branch.
59 ------------
61 Author
62 ------
63 Written by Linus Torvalds <torvalds@osdl.org> and Junio C Hamano <junkio@cox.net>
65 Documentation
66 --------------
67 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
69 GIT
70 ---
71 Part of the gitlink:git[7] suite