<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect2 SYSTEM "../../../dtd/dblite.dtd">

<sect2 lang="en" id="git-write-tree(1)">
    <title>git-write-tree(1)</title>
    <date>2024-07-02</date>
<revhistory><revision><date>2024-07-02</date></revision></revhistory>
<indexterm>
<primary>git-write-tree(1)</primary>
</indexterm>
<simplesect id="git-write-tree(1)__name">
<title>NAME</title>
<simpara>git-write-tree - Create a tree object from the current index</simpara>
</simplesect>
<simplesect id="git-write-tree(1)__synopsis">
<title>SYNOPSIS</title>
<blockquote>
<literallayout><emphasis>git write-tree</emphasis> [--missing-ok] [--prefix=&lt;prefix&gt;/]</literallayout>
</blockquote>
</simplesect>
<simplesect id="git-write-tree(1)__description">
<title>DESCRIPTION</title>
<simpara>Creates a tree object using the current index. The name of the new
tree object is printed to standard output.</simpara>
<simpara>The index must be in a fully merged state.</simpara>
<simpara>Conceptually, <emphasis>git write-tree</emphasis> 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 <emphasis>git update-index</emphasis> phase before you did the
<emphasis>git write-tree</emphasis>.</simpara>
</simplesect>
<simplesect id="git-write-tree(1)__options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>
--missing-ok
</term>
<listitem>
<simpara>
        Normally <emphasis>git write-tree</emphasis> ensures that the objects referenced by the
        directory exist in the object database.  This option disables this
        check.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--prefix=&lt;prefix&gt;/
</term>
<listitem>
<simpara>
        Writes a tree object that represents a subdirectory
        <emphasis>&lt;prefix&gt;</emphasis>.  This can be used to write the tree object
        for a subproject that is in the named subdirectory.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="git-write-tree(1)__git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
</simplesect>
</sect2>
