| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 6 |
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" /> |
| 7 |
<title>hg branch</title> |
| 8 |
<link rel="stylesheet" href="../style.css" type="text/css" /> |
| 9 |
</head> |
| 10 |
<body> |
| 11 |
<div class="document" id="hg-branch"> |
| 12 |
<span id="hg-branch-1"></span> |
| 13 |
<h1 class="title">hg branch</h1> |
| 14 |
<h2 class="subtitle" id="set-or-show-the-current-branch-name">set or show the current branch name</h2> |
| 15 |
|
| 16 |
<div class="contents htmlonly topic" id="contents"> |
| 17 |
<p class="topic-title"><a class="reference internal" href="#top">Contents</a></p> |
| 18 |
<ul class="simple"> |
| 19 |
<li><a class="reference internal" href="#synopsis" id="toc-entry-1">Synopsis</a></li> |
| 20 |
<li><a class="reference internal" href="#description" id="toc-entry-2">Description</a></li> |
| 21 |
<li><a class="reference internal" href="#options" id="toc-entry-3">Options</a></li> |
| 22 |
</ul> |
| 23 |
</div> |
| 24 |
<div class="section" id="synopsis"> |
| 25 |
<h1><a class="toc-backref" href="#contents">Synopsis</a></h1> |
| 26 |
<pre class="literal-block"> |
| 27 |
hg branch [-fC] [NAME] |
| 28 |
</pre> |
| 29 |
</div> |
| 30 |
<div class="section" id="description"> |
| 31 |
<h1><a class="toc-backref" href="#contents">Description</a></h1> |
| 32 |
<div class="admonition note"> |
| 33 |
<p class="first admonition-title">Note</p> |
| 34 |
<p class="last">Branch names are permanent and global. Use <a class="reference external" href="hg-bookmark.html"><tt class="docutils literal">hg bookmark</tt></a> to create a |
| 35 |
light-weight bookmark instead. See <a class="reference external" href="topic-glossary.html"><tt class="docutils literal">hg help glossary</tt></a> for more |
| 36 |
information about named branches and bookmarks.</p> |
| 37 |
</div> |
| 38 |
<p>With no argument, show the current branch name. With one argument, |
| 39 |
set the working directory branch name (the branch will not exist |
| 40 |
in the repository until the next commit). Standard practice |
| 41 |
recommends that primary development take place on the 'default' |
| 42 |
branch.</p> |
| 43 |
<p>Unless -f/--force is specified, branch will not let you set a |
| 44 |
branch name that already exists.</p> |
| 45 |
<p>Use -C/--clean to reset the working directory branch to that of |
| 46 |
the parent of the working directory, negating a previous branch |
| 47 |
change.</p> |
| 48 |
<p>Use the command <a class="reference external" href="hg-update.html"><tt class="docutils literal">hg update</tt></a> to switch to an existing branch. Use |
| 49 |
<a class="reference external" href="hg-commit.html"><tt class="docutils literal">hg commit <span class="pre">--close-branch</span></tt></a> to mark this branch head as closed. |
| 50 |
When all heads of a branch are closed, the branch will be |
| 51 |
considered closed.</p> |
| 52 |
<p>Returns 0 on success.</p> |
| 53 |
</div> |
| 54 |
<div class="section" id="options"> |
| 55 |
<h1><a class="toc-backref" href="#contents">Options</a></h1> |
| 56 |
<table class="docutils option-list" frame="void" rules="none"> |
| 57 |
<col class="option" /> |
| 58 |
<col class="description" /> |
| 59 |
<tbody valign="top"> |
| 60 |
<tr><td class="option-group"> |
| 61 |
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> |
| 62 |
<td>set branch name even if it shadows an existing branch</td></tr> |
| 63 |
<tr><td class="option-group"> |
| 64 |
<kbd><span class="option">-C</span>, <span class="option">--clean</span></kbd></td> |
| 65 |
<td>reset branch name to parent branch name</td></tr> |
| 66 |
<tr><td class="option-group" colspan="2"> |
| 67 |
<kbd><span class="option">-r</span>, <span class="option">--rev <var><VALUE[+]></var></span></kbd></td> |
| 68 |
</tr> |
| 69 |
<tr><td> </td><td>change branches of the given revs (EXPERIMENTAL)</td></tr> |
| 70 |
</tbody> |
| 71 |
</table> |
| 72 |
<p>[+] marked option can be specified multiple times</p> |
| 73 |
</div> |
| 74 |
</div> |
| 75 |
</body> |
| 76 |
</html> |