git-commit-tree.txt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. git-commit-tree(1)
  2. ==================
  3. NAME
  4. ----
  5. git-commit-tree - Create a new commit object
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'git commit-tree' <tree> [(-p <parent>)...]
  10. 'git commit-tree' [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]
  11. [(-F <file>)...] <tree>
  12. DESCRIPTION
  13. -----------
  14. This is usually not what an end user wants to run directly. See
  15. linkgit:git-commit[1] instead.
  16. Creates a new commit object based on the provided tree object and
  17. emits the new commit object id on stdout. The log message is read
  18. from the standard input, unless `-m` or `-F` options are given.
  19. The `-m` and `-F` options can be given any number of times, in any
  20. order. The commit log message will be composed in the order in which
  21. the options are given.
  22. A commit object may have any number of parents. With exactly one
  23. parent, it is an ordinary commit. Having more than one parent makes
  24. the commit a merge between several lines of history. Initial (root)
  25. commits have no parents.
  26. While a tree represents a particular directory state of a working
  27. directory, a commit represents that state in "time", and explains how
  28. to get there.
  29. Normally a commit would identify a new "HEAD" state, and while Git
  30. doesn't care where you save the note about that state, in practice we
  31. tend to just write the result to the file that is pointed at by
  32. `.git/HEAD`, so that we can always see what the last committed
  33. state was.
  34. OPTIONS
  35. -------
  36. <tree>::
  37. An existing tree object.
  38. -p <parent>::
  39. Each `-p` indicates the id of a parent commit object.
  40. -m <message>::
  41. A paragraph in the commit log message. This can be given more than
  42. once and each <message> becomes its own paragraph.
  43. -F <file>::
  44. Read the commit log message from the given file. Use `-` to read
  45. from the standard input. This can be given more than once and the
  46. content of each file becomes its own paragraph.
  47. -S[<keyid>]::
  48. --gpg-sign[=<keyid>]::
  49. --no-gpg-sign::
  50. GPG-sign commits. The `keyid` argument is optional and
  51. defaults to the committer identity; if specified, it must be
  52. stuck to the option without a space. `--no-gpg-sign` is useful to
  53. countermand a `--gpg-sign` option given earlier on the command line.
  54. Commit Information
  55. ------------------
  56. A commit encapsulates:
  57. - all parent object ids
  58. - author name, email and date
  59. - committer name and email and the commit time.
  60. A commit comment is read from stdin. If a changelog
  61. entry is not provided via "<" redirection, 'git commit-tree' will just wait
  62. for one to be entered and terminated with ^D.
  63. include::date-formats.txt[]
  64. Discussion
  65. ----------
  66. include::i18n.txt[]
  67. FILES
  68. -----
  69. /etc/mailname
  70. SEE ALSO
  71. --------
  72. linkgit:git-write-tree[1]
  73. linkgit:git-commit[1]
  74. GIT
  75. ---
  76. Part of the linkgit:git[1] suite