blob: 48c33d7ed7323c7fc4776ffeb98aad9b41b23744 [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 Hamanodaf0aae2015-10-26 23:14:3012'git commit-tree' <tree> [(-p <parent>)...]
Junio C Hamanocb868662013-04-02 22:41:5213'git commit-tree' [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]
14 [(-F <file>)...] <tree>
15
Junio C Hamano1a4e8412005-12-27 08:17:2316
17DESCRIPTION
18-----------
Junio C Hamanoe58607f2007-01-17 23:27:4519This is usually not what an end user wants to run directly. See
Junio C Hamano35738e82008-01-07 07:55:4620linkgit:git-commit[1] instead.
Junio C Hamanoe58607f2007-01-17 23:27:4521
Junio C Hamano1a4e8412005-12-27 08:17:2322Creates a new commit object based on the provided tree object and
Junio C Hamano515ab1d2011-12-09 23:41:2023emits the new commit object id on stdout. The log message is read
24from the standard input, unless `-m` or `-F` options are given.
Junio C Hamano1a4e8412005-12-27 08:17:2325
Junio C Hamanofaa1e502008-08-10 03:55:5826A commit object may have any number of parents. With exactly one
27parent, it is an ordinary commit. Having more than one parent makes
28the commit a merge between several lines of history. Initial (root)
29commits have no parents.
Junio C Hamano1a4e8412005-12-27 08:17:2330
31While a tree represents a particular directory state of a working
32directory, a commit represents that state in "time", and explains how
33to get there.
34
Junio C Hamano076ffcc2013-02-06 05:13:2135Normally a commit would identify a new "HEAD" state, and while Git
Junio C Hamano1a4e8412005-12-27 08:17:2336doesn't care where you save the note about that state, in practice we
37tend to just write the result to the file that is pointed at by
38`.git/HEAD`, so that we can always see what the last committed
39state was.
40
41OPTIONS
42-------
43<tree>::
44An existing tree object
45
Junio C Hamano515ab1d2011-12-09 23:41:2046-p <parent>::
Junio C Hamano1a4e8412005-12-27 08:17:2347Each '-p' indicates the id of a parent commit object.
Junio C Hamanoa77a5132007-06-08 16:13:4448
Junio C Hamano515ab1d2011-12-09 23:41:2049-m <message>::
Junio C Hamano010705a2012-06-19 23:37:2650A paragraph in the commit log message. This can be given more than
Junio C Hamano515ab1d2011-12-09 23:41:2051once and each <message> becomes its own paragraph.
52
53-F <file>::
54Read the commit log message from the given file. Use `-` to read
55from the standard input.
56
Junio C Hamanocb868662013-04-02 22:41:5257-S[<keyid>]::
Junio C Hamano5b3533d2014-02-27 23:07:1558--gpg-sign[=<keyid>]::
Junio C Hamano1eb56092015-10-05 20:39:5359GPG-sign commits. The `keyid` argument is optional and
60defaults to the committer identity; if specified, it must be
61stuck to the option without a space.
Junio C Hamanocb868662013-04-02 22:41:5262
Junio C Hamano5b3533d2014-02-27 23:07:1563--no-gpg-sign::
Junio C Hamano322c6242015-03-23 21:32:4664Countermand `commit.gpgSign` configuration variable that is
Junio C Hamano5b3533d2014-02-27 23:07:1565set to force each and every commit to be signed.
66
Junio C Hamano1a4e8412005-12-27 08:17:2367
68Commit Information
69------------------
70
71A commit encapsulates:
72
73- all parent object ids
74- author name, email and date
75- committer name and email and the commit time.
76
Junio C Hamano1b11dcb2007-08-18 07:20:5577While parent object ids are provided on the command line, author and
Junio C Hamanoa6387422007-08-25 03:54:2778committer information is taken from the following environment variables,
Junio C Hamano1b11dcb2007-08-18 07:20:5579if set:
Junio C Hamano1a4e8412005-12-27 08:17:2380
81GIT_AUTHOR_NAME
82GIT_AUTHOR_EMAIL
83GIT_AUTHOR_DATE
84GIT_COMMITTER_NAME
85GIT_COMMITTER_EMAIL
Junio C Hamano469d60e2007-04-29 18:30:3486GIT_COMMITTER_DATE
Junio C Hamano1a4e8412005-12-27 08:17:2387
88(nb "<", ">" and "\n"s are stripped)
89
Junio C Hamano1b11dcb2007-08-18 07:20:5590In case (some of) these environment variables are not set, the information
91is taken from the configuration items user.name and user.email, or, if not
Junio C Hamano5dd5fae2013-01-18 21:06:4992present, the environment variable EMAIL, or, if that is not set,
93system user name and the hostname used for outgoing mail (taken
Junio C Hamano5a73f302011-10-14 05:58:3494from `/etc/mailname` and falling back to the fully qualified hostname when
95that file does not exist).
Junio C Hamano1a4e8412005-12-27 08:17:2396
Junio C Hamanoc0ea7c62007-07-15 07:19:0697A commit comment is read from stdin. If a changelog
Junio C Hamano1aa40d22010-01-21 17:46:4398entry is not provided via "<" redirection, 'git commit-tree' will just wait
Junio C Hamano1a4e8412005-12-27 08:17:2399for one to be entered and terminated with ^D.
100
Junio C Hamanoae05fee2010-01-08 07:39:46101include::date-formats.txt[]
Junio C Hamano1a4e8412005-12-27 08:17:23102
Junio C Hamano775a0f42006-12-31 01:19:14103Discussion
104----------
105
106include::i18n.txt[]
107
Junio C Hamano5a73f302011-10-14 05:58:34108FILES
109-----
110/etc/mailname
111
Junio C Hamano9049d912008-05-29 02:09:50112SEE ALSO
Junio C Hamano1a4e8412005-12-27 08:17:23113--------
Junio C Hamano35738e82008-01-07 07:55:46114linkgit:git-write-tree[1]
Junio C Hamano1a4e8412005-12-27 08:17:23115
Junio C Hamano1a4e8412005-12-27 08:17:23116GIT
117---
Junio C Hamanof7c042d2008-06-06 22:50:53118Part of the linkgit:git[1] suite