| 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 push</title> |
| 8 |
<link rel="stylesheet" href="../style.css" type="text/css" /> |
| 9 |
</head> |
| 10 |
<body> |
| 11 |
<div class="document" id="hg-push"> |
| 12 |
<span id="hg-push-1"></span> |
| 13 |
<h1 class="title">hg push</h1> |
| 14 |
<h2 class="subtitle" id="push-changes-to-the-specified-destination">push changes to the specified destination</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 push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]... |
| 28 |
</pre> |
| 29 |
</div> |
| 30 |
<div class="section" id="description"> |
| 31 |
<h1><a class="toc-backref" href="#contents">Description</a></h1> |
| 32 |
<p>Push changesets from the local repository to the specified |
| 33 |
destination.</p> |
| 34 |
<p>This operation is symmetrical to pull: it is identical to a pull |
| 35 |
in the destination repository from the current one.</p> |
| 36 |
<p>By default, push will not allow creation of new heads at the |
| 37 |
destination, since multiple heads would make it unclear which head |
| 38 |
to use. In this situation, it is recommended to pull and merge |
| 39 |
before pushing.</p> |
| 40 |
<p>Use --new-branch if you want to allow push to create a new named |
| 41 |
branch that is not present at the destination. This allows you to |
| 42 |
only create a new branch without forcing other changes.</p> |
| 43 |
<div class="admonition note"> |
| 44 |
<p class="first admonition-title">Note</p> |
| 45 |
<p class="last">Extra care should be taken with the -f/--force option, |
| 46 |
which will push all new heads on all branches, an action which will |
| 47 |
almost always cause confusion for collaborators.</p> |
| 48 |
</div> |
| 49 |
<p>If -r/--rev is used, the specified revision and all its ancestors |
| 50 |
will be pushed to the remote repository.</p> |
| 51 |
<p>If -B/--bookmark is used, the specified bookmarked revision, its |
| 52 |
ancestors, and the bookmark will be pushed to the remote |
| 53 |
repository. Specifying <tt class="docutils literal">.</tt> is equivalent to specifying the active |
| 54 |
bookmark's name. Use the --all-bookmarks option for pushing all |
| 55 |
current bookmarks.</p> |
| 56 |
<p>Please see <a class="reference external" href="topic-urls.html"><tt class="docutils literal">hg help urls</tt></a> for important details about <tt class="docutils literal"><span class="pre">ssh://</span></tt> |
| 57 |
URLs. If DESTINATION is omitted, a default path will be used.</p> |
| 58 |
<p>When passed multiple destinations, push will process them one after the |
| 59 |
other, but stop should an error occur.</p> |
| 60 |
<div class="verbose docutils container"> |
| 61 |
<p>The --pushvars option sends strings to the server that become |
| 62 |
environment variables prepended with <tt class="docutils literal">HG_USERVAR_</tt>. For example, |
| 63 |
<tt class="docutils literal"><span class="pre">--pushvars</span> ENABLE_FEATURE=true</tt>, provides the server side hooks with |
| 64 |
<tt class="docutils literal">HG_USERVAR_ENABLE_FEATURE=true</tt> as part of their environment.</p> |
| 65 |
<p>pushvars can provide for user-overridable hooks as well as set debug |
| 66 |
levels. One example is having a hook that blocks commits containing |
| 67 |
conflict markers, but enables the user to override the hook if the file |
| 68 |
is using conflict markers for testing purposes or the file format has |
| 69 |
strings that look like conflict markers.</p> |
| 70 |
<p>By default, servers will ignore <cite>--pushvars</cite>. To enable it add the |
| 71 |
following to your configuration file:</p> |
| 72 |
<pre class="literal-block"> |
| 73 |
[push] |
| 74 |
pushvars.server = true |
| 75 |
</pre> |
| 76 |
</div> |
| 77 |
<p>Returns 0 if push was successful, 1 if nothing to push.</p> |
| 78 |
</div> |
| 79 |
<div class="section" id="options"> |
| 80 |
<h1><a class="toc-backref" href="#contents">Options</a></h1> |
| 81 |
<table class="docutils option-list" frame="void" rules="none"> |
| 82 |
<col class="option" /> |
| 83 |
<col class="description" /> |
| 84 |
<tbody valign="top"> |
| 85 |
<tr><td class="option-group"> |
| 86 |
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td> |
| 87 |
<td>force push</td></tr> |
| 88 |
<tr><td class="option-group" colspan="2"> |
| 89 |
<kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td> |
| 90 |
</tr> |
| 91 |
<tr><td> </td><td>a changeset intended to be included in the destination</td></tr> |
| 92 |
<tr><td class="option-group" colspan="2"> |
| 93 |
<kbd><span class="option">-B</span>, <span class="option">--bookmark <var><BOOKMARK[+]></var></span></kbd></td> |
| 94 |
</tr> |
| 95 |
<tr><td> </td><td>bookmark to push</td></tr> |
| 96 |
<tr><td class="option-group" colspan="2"> |
| 97 |
<kbd><span class="option">--all-bookmarks</span></kbd></td> |
| 98 |
</tr> |
| 99 |
<tr><td> </td><td>push all bookmarks (EXPERIMENTAL)</td></tr> |
| 100 |
<tr><td class="option-group" colspan="2"> |
| 101 |
<kbd><span class="option">-b</span>, <span class="option">--branch <var><BRANCH[+]></var></span></kbd></td> |
| 102 |
</tr> |
| 103 |
<tr><td> </td><td>a specific branch you would like to push</td></tr> |
| 104 |
<tr><td class="option-group"> |
| 105 |
<kbd><span class="option">--new-branch</span></kbd></td> |
| 106 |
<td>allow pushing a new branch</td></tr> |
| 107 |
<tr><td class="option-group" colspan="2"> |
| 108 |
<kbd><span class="option">--pushvars <var><VALUE[+]></var></span></kbd></td> |
| 109 |
</tr> |
| 110 |
<tr><td> </td><td>variables that can be sent to server (ADVANCED)</td></tr> |
| 111 |
<tr><td class="option-group"> |
| 112 |
<kbd><span class="option">--publish</span></kbd></td> |
| 113 |
<td>push the changeset as public (EXPERIMENTAL)</td></tr> |
| 114 |
<tr><td class="option-group" colspan="2"> |
| 115 |
<kbd><span class="option">-e</span>, <span class="option">--ssh <var><CMD></var></span></kbd></td> |
| 116 |
</tr> |
| 117 |
<tr><td> </td><td>specify ssh command to use</td></tr> |
| 118 |
<tr><td class="option-group" colspan="2"> |
| 119 |
<kbd><span class="option">--remotecmd <var><CMD></var></span></kbd></td> |
| 120 |
</tr> |
| 121 |
<tr><td> </td><td>specify hg command to run on the remote side</td></tr> |
| 122 |
<tr><td class="option-group"> |
| 123 |
<kbd><span class="option">--insecure</span></kbd></td> |
| 124 |
<td>do not verify server certificate (ignoring web.cacerts config)</td></tr> |
| 125 |
</tbody> |
| 126 |
</table> |
| 127 |
<p>[+] marked option can be specified multiple times</p> |
| 128 |
</div> |
| 129 |
</div> |
| 130 |
</body> |
| 131 |
</html> |