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