git-write-tree

Create a tree object from the current index

TLDR

Write tree from index
$ git write-tree
Write with prefix
$ git write-tree --prefix=[subdir/]
Missing OK
$ git write-tree --missing-ok

SYNOPSIS

git write-tree [options]

DESCRIPTION

git write-tree creates a tree object from the current index contents and prints the resulting tree object's SHA to standard output. It is a low-level plumbing command used internally by `git commit` to snapshot the staged file structure into a tree object in the Git object database.The index must be in a fully merged state before running this command; typically `git update-index` is used first to sync the index with the working directory.

PARAMETERS

--prefix prefix

Write subtree.
--missing-ok
Allow missing objects.

INSTALL

sudo apt install git
sudo dnf install git
sudo pacman -S git
sudo apk add git
sudo zypper install git
brew install git
nix profile install nixpkgs#git

SEE ALSO

git-commit-tree(1), git-read-tree(1), git-update-index(1)

RESOURCES

Documentation