{
    "mode": "man",
    "parameter": "GIT-WRITE-TREE",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/GIT-WRITE-TREE/1/json",
    "generated": "2026-05-30T07:11:21Z",
    "synopsis": "git write-tree [--missing-ok] [--prefix=<prefix>/]",
    "sections": {
        "NAME": {
            "content": "git-write-tree - Create a tree object from the current index\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "git write-tree [--missing-ok] [--prefix=<prefix>/]\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Creates a tree object using the current index. The name of the new tree object is printed to\nstandard output.\n\nThe index must be in a fully merged state.\n\nConceptually, git write-tree sync()s the current index contents into a set of tree files. In\norder to have that match what is actually in your directory right now, you need to have done\na git update-index phase before you did the git write-tree.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "--missing-ok",
                    "content": "Normally git write-tree ensures that the objects referenced by the directory exist in the\nobject database. This option disables this check.\n\n--prefix=<prefix>/\nWrites a tree object that represents a subdirectory <prefix>. This can be used to write\nthe tree object for a subproject that is in the named subdirectory.\n",
                    "long": "--missing-ok"
                }
            ]
        },
        "GIT": {
            "content": "Part of the git(1) suite\n\n\n\nGit 2.34.1                                   02/26/2026                            GIT-WRITE-TREE(1)",
            "subsections": []
        }
    },
    "summary": "git-write-tree - Create a tree object from the current index",
    "flags": [
        {
            "flag": "",
            "long": "--missing-ok",
            "arg": null,
            "description": "Normally git write-tree ensures that the objects referenced by the directory exist in the object database. This option disables this check. --prefix=<prefix>/ Writes a tree object that represents a subdirectory <prefix>. This can be used to write the tree object for a subproject that is in the named subdirectory."
        }
    ],
    "examples": [],
    "see_also": []
}