chiark / gitweb /
Add doc for 'branch'.
[stgit] / Documentation / stg-branch.txt
CommitLineData
8f51e145
YD
1stg-branch(1)
2=============
3Yann Dirson <ydirson@altern.org>
4v0.12.1, April 2007
5
6NAME
7----
8stg-branch - stgdesc:branch[]
9
10SYNOPSIS
11--------
12stg branch
13
14stg branch <branch>
15
16stg branch --list
17
18stg branch --create <newstack> [<commit-id>]
19
20stg branch --clone [<newstack>]
21
22stg branch --rename <oldname> <newname>
23
24stg branch --protect [<branch>]
25
26stg branch --unprotect [<branch>]
27
28stg branch --delete [--force] <branch>
29
30stg branch --convert
31
32DESCRIPTION
33-----------
34
35Assorted operations on branches.
36
37no command, no argument::
38 Display the name of the current branch.
39
40no command, one argument::
41 Switch to the named <branch>.
42
43--list::
44-l::
45 Display the list of branches in the current repository,
46 suffixed by the branch description if any, and optionally
47 prefixed by the letter flags 's' if the branch is an StGIT
48 stack, and 'p' if the StGIT stack is protected. The current
49 branch is shown with a leading ">" character.
50
51--create::
52-c::
53 Create a new StGIT stack based at the specified commit, or at
54 the current HEAD if not specified. The repository HEAD is
55 switched to the new stack.
56+
57StGIT will try to detect the branch off which the new stack is forked,
58as well as the remote repository from which that parent branch is
59taken (if any), so running stgdesc:pull[] will effectively pull new
60commits from the correct branch. It will warn if it cannot guess the
61parent branch (eg. if you do not specify a branch name as
62<commit-id>).
63
64--clone::
65 Clone the current stack, under the name <newstack> if
66 specified, or using the current stack's name suffixed by a
67 timestamp.
68+
69The description of the new stack is set to tell it is a clone of the
70current stack. The parent information of the new stack is copied from
71the current stack.
72+
73Cloning a GIT branch that is not an StGIT stack is similar to creating
74a new stack off the current branch.
75
76--rename::
77-r::
78 Rename the stack named <oldname> to <newname>.
79
80--protect::
81-p::
82 Protect the named stack or the current one, preventing
83 further StGIT operations from modifying this stack.
84
85--unprotect::
86-u::
87 Remove a "protected" flag previously set with '--protect'.
88
89--delete::
90 Delete the named <branch>. If there are any patches left in
91 the series, StGIT will refuse to delete it, unless '--force'
92 is specified.
93+
94A protected branch cannot be deleted, it must be unprotected first
95(see above).
96+
97When the current branch is deleted, the repository HEAD is switched to
98the "master" branch if it exists.
99+
100Branch "master" is treated specially (see bug #8732), in that only the
101StGIT metadata are removed, the GIT branch itself is not destroyed.
102
103--convert::
104 Switch current stack between old and new format.
105
106OPTIONS
107-------
108
109--force::
110 Force a delete when the series is not empty.
111
112FILES
113-----
114
115 $GIT_DIR/patches/<branch>/description
116 $GIT_DIR/patches/<branch>/protected
117
118GIT CONFIGURATION VARIABLES
119---------------------------
120
121 branch.<branchname>.remote
122 branch.<branchname>.merge
123 branch.<branchname>.stgit.parentbranch
124
125StGIT
126-----
127Part of the StGIT suite - see gitlink:stg[1].