blob: 6d5a04c83b6461396b44b3972a539eaae6368a19 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-commit-tree(1)
2==================
3
4NAME
5----
Junio C Hamano7c73c662007-01-19 00:37:506git-commit-tree - Create a new commit object
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamano15567bc2011-07-23 00:51:5911[verse]
Junio C Hamano515ab1d2011-12-09 23:41:2012'git commit-tree' <tree> [(-p <parent>)...] < changelog
Junio C Hamano44dcd492012-07-24 04:35:3813'git commit-tree' [(-p <parent>)...] [(-m <message>)...] [(-F <file>)...] <tree>
Junio C Hamano1a4e8412005-12-27 08:17:2314
15DESCRIPTION
16-----------
Junio C Hamanoe58607f2007-01-17 23:27:4517This is usually not what an end user wants to run directly. See
Junio C Hamano35738e82008-01-07 07:55:4618linkgit:git-commit[1] instead.
Junio C Hamanoe58607f2007-01-17 23:27:4519
Junio C Hamano1a4e8412005-12-27 08:17:2320Creates a new commit object based on the provided tree object and
Junio C Hamano515ab1d2011-12-09 23:41:2021emits the new commit object id on stdout. The log message is read
22from the standard input, unless `-m` or `-F` options are given.
Junio C Hamano1a4e8412005-12-27 08:17:2323
Junio C Hamanofaa1e502008-08-10 03:55:5824A commit object may have any number of parents. With exactly one
25parent, it is an ordinary commit. Having more than one parent makes
26the commit a merge between several lines of history. Initial (root)
27commits have no parents.
Junio C Hamano1a4e8412005-12-27 08:17:2328
29While a tree represents a particular directory state of a working
30directory, a commit represents that state in "time", and explains how
31to get there.
32
33Normally a commit would identify a new "HEAD" state, and while git
34doesn't care where you save the note about that state, in practice we
35tend to just write the result to the file that is pointed at by
36`.git/HEAD`, so that we can always see what the last committed
37state was.
38
39OPTIONS
40-------
41<tree>::
42An existing tree object
43
Junio C Hamano515ab1d2011-12-09 23:41:2044-p <parent>::
Junio C Hamano1a4e8412005-12-27 08:17:2345Each '-p' indicates the id of a parent commit object.
Junio C Hamanoa77a5132007-06-08 16:13:4446
Junio C Hamano515ab1d2011-12-09 23:41:2047-m <message>::
Junio C Hamano010705a2012-06-19 23:37:2648A paragraph in the commit log message. This can be given more than
Junio C Hamano515ab1d2011-12-09 23:41:2049once and each <message> becomes its own paragraph.
50
51-F <file>::
52Read the commit log message from the given file. Use `-` to read
53from the standard input.
54
Junio C Hamano1a4e8412005-12-27 08:17:2355
56Commit Information
57------------------
58
59A commit encapsulates:
60
61- all parent object ids
62- author name, email and date
63- committer name and email and the commit time.
64
Junio C Hamano1b11dcb2007-08-18 07:20:5565While parent object ids are provided on the command line, author and
Junio C Hamanoa6387422007-08-25 03:54:2766committer information is taken from the following environment variables,
Junio C Hamano1b11dcb2007-08-18 07:20:5567if set:
Junio C Hamano1a4e8412005-12-27 08:17:2368
69GIT_AUTHOR_NAME
70GIT_AUTHOR_EMAIL
71GIT_AUTHOR_DATE
72GIT_COMMITTER_NAME
73GIT_COMMITTER_EMAIL
Junio C Hamano469d60e2007-04-29 18:30:3474GIT_COMMITTER_DATE
75EMAIL
Junio C Hamano1a4e8412005-12-27 08:17:2376
77(nb "<", ">" and "\n"s are stripped)
78
Junio C Hamano1b11dcb2007-08-18 07:20:5579In case (some of) these environment variables are not set, the information
80is taken from the configuration items user.name and user.email, or, if not
Junio C Hamano5a73f302011-10-14 05:58:3481present, system user name and the hostname used for outgoing mail (taken
82from `/etc/mailname` and falling back to the fully qualified hostname when
83that file does not exist).
Junio C Hamano1a4e8412005-12-27 08:17:2384
Junio C Hamanoc0ea7c62007-07-15 07:19:0685A commit comment is read from stdin. If a changelog
Junio C Hamano1aa40d22010-01-21 17:46:4386entry is not provided via "<" redirection, 'git commit-tree' will just wait
Junio C Hamano1a4e8412005-12-27 08:17:2387for one to be entered and terminated with ^D.
88
Junio C Hamanoae05fee2010-01-08 07:39:4689include::date-formats.txt[]
Junio C Hamano1a4e8412005-12-27 08:17:2390
Junio C Hamano775a0f42006-12-31 01:19:1491Discussion
92----------
93
94include::i18n.txt[]
95
Junio C Hamano5a73f302011-10-14 05:58:3496FILES
97-----
98/etc/mailname
99
Junio C Hamano9049d912008-05-29 02:09:50100SEE ALSO
Junio C Hamano1a4e8412005-12-27 08:17:23101--------
Junio C Hamano35738e82008-01-07 07:55:46102linkgit:git-write-tree[1]
Junio C Hamano1a4e8412005-12-27 08:17:23103
Junio C Hamano1a4e8412005-12-27 08:17:23104GIT
105---
Junio C Hamanof7c042d2008-06-06 22:50:53106Part of the linkgit:git[1] suite