<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>commit — Bazaar v2.2.4 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '2.2.4', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <link rel="shortcut icon" href="../_static/bzr.ico"/> <link rel="top" title="Bazaar v2.2.4 documentation" href="../index.html" /> <link rel="up" title="Bazaar User Reference" href="index.html" /> <link rel="next" title="conflicts" href="conflicts-help.html" /> <link rel="prev" title="clean-tree" href="clean-tree-help.html" /> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="conflicts-help.html" title="conflicts" accesskey="N">next</a></li> <li class="right" > <a href="clean-tree-help.html" title="clean-tree" accesskey="P">previous</a> |</li> <li><a href="http://bazaar.canonical.com/"> <img src="../_static/bzr icon 16.png" /> Home</a> | </li> <a href="http://doc.bazaar.canonical.com/en/">Documentation</a> | </li> <li><a href="../index.html">Table of Contents (2.2.4)</a> »</li> <li><a href="index.html" accesskey="U">Bazaar User Reference</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="commit"> <h1>commit<a class="headerlink" href="#commit" title="Permalink to this headline">ΒΆ</a></h1> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field"><th class="field-name">Purpose:</th><td class="field-body"><p class="first">Commit changes into a new revision.</p> </td> </tr> <tr class="field"><th class="field-name">Usage:</th><td class="field-body"><p class="first">bzr commit [SELECTED...]</p> </td> </tr> <tr class="field"><th class="field-name">Options:</th><td class="field-body"><table class="first docutils option-list" frame="void" rules="none"> <col class="option" /> <col class="description" /> <tbody valign="top"> <tr><td class="option-group"> <kbd><span class="option">-v</span>, <span class="option">--verbose</span></kbd></td> <td><p class="first last">Display more information.</p> </td></tr> <tr><td class="option-group"> <kbd><span class="option">--author=<var>ARG</var></span></kbd></td> <td><p class="first last">Set the author’s name, if it’s different from the committer.</p> </td></tr> <tr><td class="option-group" colspan="2"> <kbd><span class="option">--commit-time=<var>ARG</var></span></kbd></td> </tr> <tr><td> </td><td><p class="first last">Manually set a commit time using commit date format, e.g. ‘2009-10-10 08:00:00 +0100’.</p> </td></tr> <tr><td class="option-group"> <kbd><span class="option">--unchanged</span></kbd></td> <td><p class="first last">Commit even if nothing has changed.</p> </td></tr> <tr><td class="option-group"> <kbd><span class="option">--fixes=<var>ARG</var></span></kbd></td> <td><p class="first last">Mark a bug as being fixed by this revision (see “bzr help bugs”).</p> </td></tr> <tr><td class="option-group"> <kbd><span class="option">-q</span>, <span class="option">--quiet</span></kbd></td> <td><p class="first last">Only display errors and warnings.</p> </td></tr> <tr><td class="option-group" colspan="2"> <kbd><span class="option">-p</span>, <span class="option">--show-diff</span></kbd></td> </tr> <tr><td> </td><td><p class="first last">When no message is supplied, show the diff along with the status summary in the message editor.</p> </td></tr> <tr><td class="option-group"> <kbd><span class="option">--strict</span></kbd></td> <td><p class="first last">Refuse to commit if there are unknown files in the working tree.</p> </td></tr> <tr><td class="option-group" colspan="2"> <kbd><span class="option">-F <var>MSGFILE</var></span>, <span class="option">--file=<var>MSGFILE</var></span></kbd></td> </tr> <tr><td> </td><td><p class="first last">Take commit message from this file.</p> </td></tr> <tr><td class="option-group"> <kbd><span class="option">--usage</span></kbd></td> <td><p class="first last">Show usage message and options.</p> </td></tr> <tr><td class="option-group" colspan="2"> <kbd><span class="option">-x <var>ARG</var></span>, <span class="option">--exclude=<var>ARG</var></span></kbd></td> </tr> <tr><td> </td><td><p class="first last">Do not consider changes made to a given path.</p> </td></tr> <tr><td class="option-group" colspan="2"> <kbd><span class="option">-m <var>ARG</var></span>, <span class="option">--message=<var>ARG</var></span></kbd></td> </tr> <tr><td> </td><td><p class="first last">Description of the new revision.</p> </td></tr> <tr><td class="option-group"> <kbd><span class="option">--local</span></kbd></td> <td><p class="first last">Perform a local commit in a bound branch. Local commits are not pushed to the master branch until a normal commit is performed.</p> </td></tr> <tr><td class="option-group"> <kbd><span class="option">-h</span>, <span class="option">--help</span></kbd></td> <td><p class="first last">Show help message.</p> </td></tr> </tbody> </table> </td> </tr> <tr class="field"><th class="field-name">Description:</th><td class="field-body"><p class="first">An explanatory message needs to be given for each commit. This is often done by using the –message option (getting the message from the command line) or by using the –file option (getting the message from a file). If neither of these options is given, an editor is opened for the user to enter the message. To see the changed files in the boilerplate text loaded into the editor, use the –show-diff option.</p> <p>By default, the entire tree is committed and the person doing the commit is assumed to be the author. These defaults can be overridden as explained below.</p> </td> </tr> <tr class="field"><th class="field-name" colspan="2">Selective commits:</th></tr> <tr><td> </td><td class="field-body"><p class="first">If selected files are specified, only changes to those files are committed. If a directory is specified then the directory and everything within it is committed.</p> <p>When excludes are given, they take precedence over selected files. For example, to commit only changes within foo, but not changes within foo/bar:</p> <div class="highlight-python"><pre>bzr commit foo -x foo/bar</pre> </div> <p>A selective commit after a merge is not yet supported.</p> </td> </tr> <tr class="field"><th class="field-name">Custom authors:</th><td class="field-body"><p class="first">If the author of the change is not the same person as the committer, you can specify the author’s name using the –author option. The name should be in the same format as a committer-id, e.g. “John Doe <<a class="reference external" href="mailto:jdoe%40example.com">jdoe<span>@</span>example<span>.</span>com</a>>”. If there is more than one author of the change you can specify the option multiple times, once for each author.</p> </td> </tr> <tr class="field"><th class="field-name">Checks:</th><td class="field-body"><p class="first">A common mistake is to forget to add a new file or directory before running the commit command. The –strict option checks for unknown files and aborts the commit if any are found. More advanced pre-commit checks can be implemented by defining hooks. See <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">help</span> <span class="pre">hooks</span></tt> for details.</p> </td> </tr> <tr class="field"><th class="field-name">Things to note:</th><td class="field-body"><p class="first">If you accidentially commit the wrong changes or make a spelling mistake in the commit message say, you can use the uncommit command to undo it. See <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">help</span> <span class="pre">uncommit</span></tt> for details.</p> <p>Hooks can also be configured to run after a commit. This allows you to trigger updates to external systems like bug trackers. The –fixes option can be used to record the association between a revision and one or more bugs. See <tt class="docutils literal"><span class="pre">bzr</span> <span class="pre">help</span> <span class="pre">bugs</span></tt> for details.</p> <p>A selective commit may fail in some cases where the committed tree would be invalid. Consider:</p> <div class="highlight-python"><pre>bzr init foo mkdir foo/bar bzr add foo/bar bzr commit foo -m "committing foo" bzr mv foo/bar foo/baz mkdir foo/bar bzr add foo/bar bzr commit foo/bar -m "committing bar but not baz"</pre> </div> <p>In the example above, the last commit will fail by design. This gives the user the opportunity to decide whether they want to commit the rename at the same time, separately first, or not at all. (As a general rule, when in doubt, Bazaar has a policy of Doing the Safe Thing.)</p> </td> </tr> <tr class="field"><th class="field-name">Aliases:</th><td class="field-body"><p class="first">ci, checkin</p> </td> </tr> <tr class="field"><th class="field-name">See also:</th><td class="field-body"><p class="first last"><a class="reference internal" href="add-help.html"><em>add</em></a>, <a class="reference internal" href="bugs-help.html"><em>bugs</em></a>, <a class="reference internal" href="hooks-help.html"><em>hooks</em></a>, <a class="reference internal" href="uncommit-help.html"><em>uncommit</em></a></p> </td> </tr> </tbody> </table> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h4>Previous topic</h4> <p class="topless"><a href="clean-tree-help.html" title="previous chapter">clean-tree</a></p> <h4>Next topic</h4> <p class="topless"><a href="conflicts-help.html" title="next chapter">conflicts</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/user-reference/commit-help.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" size="18" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="conflicts-help.html" title="conflicts" >next</a></li> <li class="right" > <a href="clean-tree-help.html" title="clean-tree" >previous</a> |</li> <li><a href="http://bazaar.canonical.com/"> <img src="../_static/bzr icon 16.png" /> Home</a> | </li> <a href="http://doc.bazaar.canonical.com/en/">Documentation</a> | </li> <li><a href="../index.html">Table of Contents (2.2.4)</a> »</li> <li><a href="index.html" >Bazaar User Reference</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009, Canonical Ltd. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. </div> </body> </html>