Create a commit object reading the message from a file (use - for stdin)

git commit-tree

  • Low level utility to create commit objects.
    See also: `git commit`.
    More information: <https://git-scm.com/docs/git-commit-tree>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

git commit-tree {{tree}} -F {{path/to/file}}

click the source code to copy install git commit-tree on any operating system with command-not-found.com