summaryrefslogtreecommitdiff
path: root/devdocs/git/git-write-tree.html
blob: b032689e07ef5bce08568a75110c66d25763e8c9 (plain)
1
2
3
4
5
6
<h1>git-write-tree</h1>  <h2 id="_name">Name</h2> <div class="sectionbody">  <p>git-write-tree - Create a tree object from the current index</p>  </div>   <h2 id="_synopsis">Synopsis</h2> <div class="sectionbody"> <div class="verseblock"> <pre class="content" data-language="shell">git write-tree [--missing-ok] [--prefix=&lt;prefix&gt;/]</pre> </div> </div>   <h2 id="_description">Description</h2> <div class="sectionbody">  <p>Creates a tree object using the current index. The name of the new tree object is printed to standard output.</p>   <p>The index must be in a fully merged state.</p>   <p>Conceptually, <code>git write-tree</code> sync()s the current index contents into a set of tree files. In order to have that match what is actually in your directory right now, you need to have done a <code>git update-index</code> phase before you did the <code>git write-tree</code>.</p>  </div>   <h2 id="_options">Options</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-write-tree.txt---missing-ok"> --missing-ok </dt> <dd> <p>Normally <code>git write-tree</code> ensures that the objects referenced by the directory exist in the object database. This option disables this check.</p> </dd> <dt class="hdlist1" id="Documentation/git-write-tree.txt---prefixltprefixgt"> --prefix=&lt;prefix&gt;/ </dt> <dd> <p>Writes a tree object that represents a subdirectory <code>&lt;prefix&gt;</code>. This can be used to write the tree object for a subproject that is in the named subdirectory.</p> </dd> </dl> </div> </div><div class="_attribution">
  <p class="_attribution-p">
    &copy; 2012&ndash;2024 Scott Chacon and others<br>Licensed under the MIT License.<br>
    <a href="https://git-scm.com/docs/git-write-tree" class="_attribution-link">https://git-scm.com/docs/git-write-tree</a>
  </p>
</div>