GIT-MKTREE(1)

πŸŽ€ git-mktree πŸŽ€

okay so bestie, welcome to git-mktree β€” the git manual page where we literally hand-build a tree object from ls-tree-formatted text. yes, from scratch. it's giving arts and crafts but make it git. πŸ’…


✨ NAME ✨

git-mktree β€” build a tree-object from ls-tree formatted text 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

git mktree [-z] [--missing] [--batch]

that's it. that's the whole vibe check. no cap. ✨


πŸ’– DESCRIPTION πŸ’–

okay so here's the tea: git-mktree reads standard input in non-recursive ls-tree output format, and creates a tree object out of it. iconic behavior honestly.

and the best part? the order of the tree entries is normalized by mktree β€” so you do not need to pre-sort your input. like, at all. just throw it in there, she'll handle it. 🫢

then the object name of the tree object it built gets written to the standard output. slay. πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • -z β€” read the NUL-terminated ls-tree -z output instead. different delimiter, same energy. 🌈
  • --missing β€” allow missing objects. sounds chaotic but hear me out: the default behaviour (i.e. without this option) is to verify that each tree entry's hash identifies an existing object. so if you don't pass this, she's checking everybody's ID at the door. πŸ”₯
heads up bestie: this option has no effect on the treatment of gitlink entries (aka "submodules"), which are always allowed to be missing. they get a permanent VIP pass, iykyk. πŸ’€
  • --batch β€” allow building of more than one tree object before exiting. each tree is separated by a single blank line. the final newline is optional. ⭐
note: if the -z option is used, lines are terminated with NUL. don't forget or it's gonna be a whole thing 😭

πŸ‘‘ GIT πŸ‘‘

part of the git(1) suite. one of the family. the nepo baby of version control, but like, in a good way. 🧚


and that's the whole page, bestie β€” go build some trees πŸ’œ

this has been Git 2.56.0, dated 2026-09-27, signing off from the GIT-MKTREE(1) manual page. mwah. πŸ’‹βœ¨

πŸ“¦ where this page comes from