{
    "mode": "info",
    "parameter": "git-write-tree",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/git-write-tree/json",
    "generated": "2026-07-12T00:34:25Z",
    "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",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Creates a tree object using the current index. The name of the new tree\nobject is printed to standard output.\n\nThe index must be in a fully merged state.\n\nConceptually, git write-tree sync()s the current index contents into a\nset of tree files. In order to have that match what is actually in your\ndirectory right now, you need to have done a git update-index phase\nbefore 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\ndirectory exist in the object database. This option disables this\ncheck.\n\n--prefix=<prefix>/\nWrites a tree object that represents a subdirectory <prefix>. This\ncan be used to write the tree object for a subproject that is in\nthe named subdirectory.\n",
                    "long": "--missing-ok"
                }
            ]
        },
        "GIT": {
            "content": "Part of the git(1) suite\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": []
}