chiark / gitweb /
Allow 'show' and 'id' to work on non-StGIT branches (bug #10011)
[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--------
d1d7d28d
YD
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>
6d159dce 19'stg' branch --description=<description> [<branch>]
d1d7d28d
YD
20'stg' branch --protect [<branch>]
21'stg' branch --unprotect [<branch>]
22'stg' branch --delete [--force] <branch>
8f51e145
YD
23
24DESCRIPTION
25-----------
26
27Assorted operations on branches.
28
29no command, no argument::
30 Display the name of the current branch.
31
32no command, one argument::
33 Switch to the named <branch>.
34
d1d7d28d 35'stg' branch [-l | --list]::
8f51e145
YD
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
d1d7d28d 42'stg' branch [-c | --create]::
8f51e145
YD
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+
47StGIT will try to detect the branch off which the new stack is forked,
48as well as the remote repository from which that parent branch is
36f28f9d 49taken (if any), so running stglink:pull[] will effectively pull new
8f51e145
YD
50commits from the correct branch. It will warn if it cannot guess the
51parent branch (eg. if you do not specify a branch name as
52<commit-id>).
53
d1d7d28d 54'stg' branch --clone::
8f51e145
YD
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+
59The description of the new stack is set to tell it is a clone of the
60current stack. The parent information of the new stack is copied from
61the current stack.
62+
63Cloning a GIT branch that is not an StGIT stack is similar to creating
64a new stack off the current branch.
65
d1d7d28d 66'stg' branch [-r | --rename]::
8f51e145
YD
67 Rename the stack named <oldname> to <newname>.
68
6d159dce
YD
69'stg' branch [-d <desc> | --description=<desc>]::
70 Set the branch description.
71
d1d7d28d 72'stg' branch [-p | --protect]::
8f51e145
YD
73 Protect the named stack or the current one, preventing
74 further StGIT operations from modifying this stack.
75
d1d7d28d 76'stg' branch [-u | --unprotect]::
8f51e145
YD
77 Remove a "protected" flag previously set with '--protect'.
78
d1d7d28d 79'stg' branch --delete::
8f51e145
YD
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+
84A protected branch cannot be deleted, it must be unprotected first
85(see above).
86+
87When the current branch is deleted, the repository HEAD is switched to
88the "master" branch if it exists.
89+
90Branch "master" is treated specially (see bug #8732), in that only the
91StGIT metadata are removed, the GIT branch itself is not destroyed.
92
8f51e145
YD
93OPTIONS
94-------
95
96--force::
97 Force a delete when the series is not empty.
98
99FILES
100-----
101
102 $GIT_DIR/patches/<branch>/description
103 $GIT_DIR/patches/<branch>/protected
104
105GIT CONFIGURATION VARIABLES
106---------------------------
107
108 branch.<branchname>.remote
109 branch.<branchname>.merge
110 branch.<branchname>.stgit.parentbranch
111
112StGIT
113-----
114Part of the StGIT suite - see gitlink:stg[1].