snippetbashTip
git mktree — Build a tree object using `ls-tree` formatted text. More information: <https://git-scm.com/docs/git-
Viewed 0 times
commandbuildtreeobjectcliusinggit mktree
Problem
How to use the
git mktree command: Build a tree object using ls-tree formatted text. More information: <https://git-scm.com/docs/git-mktree>.Solution
git mktree — Build a tree object using ls-tree formatted text. More information: <https://git-scm.com/docs/git-mktree>.Build a tree object and verify that each tree entry's hash identifies an existing object:
git mktreeAllow missing objects:
git mktree --missingRead the NUL ([z]ero character) terminated output of the tree object (
git ls-tree -z):git mktree -zAllow the creation of multiple tree objects:
git mktree --batchSort and build a tree from
stdin (non-recursive git ls-tree output format is required):git < {{path/to/tree.txt}} mktreeCode Snippets
Build a tree object and verify that each tree entry's hash identifies an existing object
git mktreeAllow missing objects
git mktree --missingRead the NUL ([z]ero character) terminated output of the tree object (`git ls-tree -z`)
git mktree -zAllow the creation of multiple tree objects
git mktree --batchSort and build a tree from `stdin` (non-recursive `git ls-tree` output format is required)
git < {{path/to/tree.txt}} mktreeContext
tldr-pages: common/git mktree
Revisions (0)
No revisions yet.