logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

git-commit-tree.1 (9030B)


  1. '\" t
  2. .\" Title: git-commit-tree
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
  5. .\" Date: 2025-03-14
  6. .\" Manual: Git Manual
  7. .\" Source: Git 2.49.0
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-COMMIT\-TREE" "1" "2025-03-14" "Git 2\&.49\&.0" "Git Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-commit-tree \- Create a new commit object
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit commit\-tree\fR <tree> [(\-p <parent>)\&...\:]
  36. \fIgit commit\-tree\fR [(\-p <parent>)\&...\:] [\-S[<keyid>]] [(\-m <message>)\&...\:]
  37. [(\-F <file>)\&...\:] <tree>
  38. .fi
  39. .SH "DESCRIPTION"
  40. .sp
  41. This is usually not what an end user wants to run directly\&. See \fBgit-commit\fR(1) instead\&.
  42. .sp
  43. Creates a new commit object based on the provided tree object and emits the new commit object id on stdout\&. The log message is read from the standard input, unless \fB\-m\fR or \fB\-F\fR options are given\&.
  44. .sp
  45. The \fB\-m\fR and \fB\-F\fR options can be given any number of times, in any order\&. The commit log message will be composed in the order in which the options are given\&.
  46. .sp
  47. A commit object may have any number of parents\&. With exactly one parent, it is an ordinary commit\&. Having more than one parent makes the commit a merge between several lines of history\&. Initial (root) commits have no parents\&.
  48. .sp
  49. While a tree represents a particular directory state of a working directory, a commit represents that state in "time", and explains how to get there\&.
  50. .sp
  51. Normally a commit would identify a new "HEAD" state, and while Git doesn\(cqt care where you save the note about that state, in practice we tend to just write the result to the file that is pointed at by \&.\fBgit/HEAD\fR, so that we can always see what the last committed state was\&.
  52. .SH "OPTIONS"
  53. .PP
  54. <tree>
  55. .RS 4
  56. An existing tree object\&.
  57. .RE
  58. .PP
  59. \-p <parent>
  60. .RS 4
  61. Each
  62. \fB\-p\fR
  63. indicates the id of a parent commit object\&.
  64. .RE
  65. .PP
  66. \-m <message>
  67. .RS 4
  68. A paragraph in the commit log message\&. This can be given more than once and each <message> becomes its own paragraph\&.
  69. .RE
  70. .PP
  71. \-F <file>
  72. .RS 4
  73. Read the commit log message from the given file\&. Use
  74. \fB\-\fR
  75. to read from the standard input\&. This can be given more than once and the content of each file becomes its own paragraph\&.
  76. .RE
  77. .PP
  78. \-S[<keyid>], \-\-gpg\-sign[=<keyid>], \-\-no\-gpg\-sign
  79. .RS 4
  80. GPG\-sign commits\&. The
  81. \fBkeyid\fR
  82. argument is optional and defaults to the committer identity; if specified, it must be stuck to the option without a space\&.
  83. \fB\-\-no\-gpg\-sign\fR
  84. is useful to countermand a
  85. \fB\-\-gpg\-sign\fR
  86. option given earlier on the command line\&.
  87. .RE
  88. .SH "COMMIT INFORMATION"
  89. .sp
  90. A commit encapsulates:
  91. .sp
  92. .RS 4
  93. .ie n \{\
  94. \h'-04'\(bu\h'+03'\c
  95. .\}
  96. .el \{\
  97. .sp -1
  98. .IP \(bu 2.3
  99. .\}
  100. all parent object ids
  101. .RE
  102. .sp
  103. .RS 4
  104. .ie n \{\
  105. \h'-04'\(bu\h'+03'\c
  106. .\}
  107. .el \{\
  108. .sp -1
  109. .IP \(bu 2.3
  110. .\}
  111. author name, email and date
  112. .RE
  113. .sp
  114. .RS 4
  115. .ie n \{\
  116. \h'-04'\(bu\h'+03'\c
  117. .\}
  118. .el \{\
  119. .sp -1
  120. .IP \(bu 2.3
  121. .\}
  122. committer name and email and the commit time\&.
  123. .RE
  124. .sp
  125. A commit comment is read from stdin\&. If a changelog entry is not provided via "<" redirection, \fIgit commit\-tree\fR will just wait for one to be entered and terminated with ^D\&.
  126. .SH "DATE FORMATS"
  127. .sp
  128. The \fBGIT_AUTHOR_DATE\fR and \fBGIT_COMMITTER_DATE\fR environment variables support the following date formats:
  129. .PP
  130. Git internal format
  131. .RS 4
  132. It is
  133. \fI<unix\-timestamp>\fR
  134. \fI<time\-zone\-offset>\fR, where
  135. \fI<unix\-timestamp>\fR
  136. is the number of seconds since the UNIX epoch\&.
  137. \fI<time\-zone\-offset>\fR
  138. is a positive or negative offset from UTC\&. For example CET (which is 1 hour ahead of UTC) is
  139. \fB+0100\fR\&.
  140. .RE
  141. .PP
  142. RFC 2822
  143. .RS 4
  144. The standard date format as described by RFC 2822, for example
  145. \fBThu,\fR
  146. \fB07\fR
  147. \fBApr\fR
  148. \fB2005\fR
  149. \fB22:13:13\fR
  150. \fB+0200\fR\&.
  151. .RE
  152. .PP
  153. ISO 8601
  154. .RS 4
  155. Time and date specified by the ISO 8601 standard, for example
  156. \fB2005\-04\-07T22:13:13\fR\&. The parser accepts a space instead of the
  157. \fBT\fR
  158. character as well\&. Fractional parts of a second will be ignored, for example
  159. \fB2005\-04\-07T22:13:13\&.019\fR
  160. will be treated as
  161. \fB2005\-04\-07T22:13:13\fR\&.
  162. .if n \{\
  163. .sp
  164. .\}
  165. .RS 4
  166. .it 1 an-trap
  167. .nr an-no-space-flag 1
  168. .nr an-break-flag 1
  169. .br
  170. .ps +1
  171. \fBNote\fR
  172. .ps -1
  173. .br
  174. In addition, the date part is accepted in the following formats:
  175. \fBYYYY\&.MM\&.DD\fR,
  176. \fBMM/DD/YYYY\fR
  177. and
  178. \fBDD\&.MM\&.YYYY\fR\&.
  179. .sp .5v
  180. .RE
  181. .RE
  182. .SH "DISCUSSION"
  183. .sp
  184. Git is to some extent character encoding agnostic\&.
  185. .sp
  186. .RS 4
  187. .ie n \{\
  188. \h'-04'\(bu\h'+03'\c
  189. .\}
  190. .el \{\
  191. .sp -1
  192. .IP \(bu 2.3
  193. .\}
  194. The contents of the blob objects are uninterpreted sequences of bytes\&. There is no encoding translation at the core level\&.
  195. .RE
  196. .sp
  197. .RS 4
  198. .ie n \{\
  199. \h'-04'\(bu\h'+03'\c
  200. .\}
  201. .el \{\
  202. .sp -1
  203. .IP \(bu 2.3
  204. .\}
  205. Path names are encoded in UTF\-8 normalization form C\&. This applies to tree objects, the index file, ref names, as well as path names in command line arguments, environment variables and config files (\&.\fBgit/config\fR
  206. (see
  207. \fBgit-config\fR(1)),
  208. \fBgitignore\fR(5),
  209. \fBgitattributes\fR(5)
  210. and
  211. \fBgitmodules\fR(5))\&.
  212. .sp
  213. Note that Git at the core level treats path names simply as sequences of non\-NUL bytes, there are no path name encoding conversions (except on Mac and Windows)\&. Therefore, using non\-ASCII path names will mostly work even on platforms and file systems that use legacy extended ASCII encodings\&. However, repositories created on such systems will not work properly on UTF\-8\-based systems (e\&.g\&. Linux, Mac, Windows) and vice versa\&. Additionally, many Git\-based tools simply assume path names to be UTF\-8 and will fail to display other encodings correctly\&.
  214. .RE
  215. .sp
  216. .RS 4
  217. .ie n \{\
  218. \h'-04'\(bu\h'+03'\c
  219. .\}
  220. .el \{\
  221. .sp -1
  222. .IP \(bu 2.3
  223. .\}
  224. Commit log messages are typically encoded in UTF\-8, but other extended ASCII encodings are also supported\&. This includes ISO\-8859\-x, CP125x and many others, but
  225. \fInot\fR
  226. UTF\-16/32, EBCDIC and CJK multi\-byte encodings (GBK, Shift\-JIS, Big5, EUC\-x, CP9xx etc\&.)\&.
  227. .RE
  228. .sp
  229. Although we encourage that the commit log messages are encoded in UTF\-8, both the core and Git Porcelain are designed not to force UTF\-8 on projects\&. If all participants of a particular project find it more convenient to use legacy encodings, Git does not forbid it\&. However, there are a few things to keep in mind\&.
  230. .sp
  231. .RS 4
  232. .ie n \{\
  233. \h'-04' 1.\h'+01'\c
  234. .\}
  235. .el \{\
  236. .sp -1
  237. .IP " 1." 4.2
  238. .\}
  239. \fBgit\fR
  240. \fBcommit\fR
  241. and
  242. \fBgit\fR
  243. \fBcommit\-tree\fR
  244. issue a warning if the commit log message given to it does not look like a valid UTF\-8 string, unless you explicitly say your project uses a legacy encoding\&. The way to say this is to have
  245. \fBi18n\&.commitEncoding\fR
  246. in \&.\fBgit/config\fR
  247. file, like this:
  248. .sp
  249. .if n \{\
  250. .RS 4
  251. .\}
  252. .nf
  253. [i18n]
  254. commitEncoding = ISO\-8859\-1
  255. .fi
  256. .if n \{\
  257. .RE
  258. .\}
  259. .sp
  260. Commit objects created with the above setting record the value of
  261. \fBi18n\&.commitEncoding\fR
  262. in their
  263. \fBencoding\fR
  264. header\&. This is to help other people who look at them later\&. Lack of this header implies that the commit log message is encoded in UTF\-8\&.
  265. .RE
  266. .sp
  267. .RS 4
  268. .ie n \{\
  269. \h'-04' 2.\h'+01'\c
  270. .\}
  271. .el \{\
  272. .sp -1
  273. .IP " 2." 4.2
  274. .\}
  275. \fBgit\fR
  276. \fBlog\fR,
  277. \fBgit\fR
  278. \fBshow\fR,
  279. \fBgit\fR
  280. \fBblame\fR
  281. and friends look at the
  282. \fBencoding\fR
  283. header of a commit object, and try to re\-code the log message into UTF\-8 unless otherwise specified\&. You can specify the desired output encoding with
  284. \fBi18n\&.logOutputEncoding\fR
  285. in \&.\fBgit/config\fR
  286. file, like this:
  287. .sp
  288. .if n \{\
  289. .RS 4
  290. .\}
  291. .nf
  292. [i18n]
  293. logOutputEncoding = ISO\-8859\-1
  294. .fi
  295. .if n \{\
  296. .RE
  297. .\}
  298. .sp
  299. If you do not have this configuration variable, the value of
  300. \fBi18n\&.commitEncoding\fR
  301. is used instead\&.
  302. .RE
  303. .sp
  304. Note that we deliberately chose not to re\-code the commit log message when a commit is made to force UTF\-8 at the commit object level, because re\-coding to UTF\-8 is not necessarily a reversible operation\&.
  305. .SH "FILES"
  306. .sp
  307. /etc/mailname
  308. .SH "SEE ALSO"
  309. .sp
  310. \fBgit-write-tree\fR(1) \fBgit-commit\fR(1)
  311. .SH "GIT"
  312. .sp
  313. Part of the \fBgit\fR(1) suite