blob: 02133d5fc9a14df7f4fe24d97bdf9980e77f807a [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 Hamanod2179ef2010-10-22 04:12:1712'git commit-tree' <tree> [(-p <parent commit>)...] < changelog
Junio C Hamano1a4e8412005-12-27 08:17:2313
14DESCRIPTION
15-----------
Junio C Hamanoe58607f2007-01-17 23:27:4516This is usually not what an end user wants to run directly. See
Junio C Hamano35738e82008-01-07 07:55:4617linkgit:git-commit[1] instead.
Junio C Hamanoe58607f2007-01-17 23:27:4518
Junio C Hamano1a4e8412005-12-27 08:17:2319Creates a new commit object based on the provided tree object and
Junio C Hamanofaa1e502008-08-10 03:55:5820emits the new commit object id on stdout.
Junio C Hamano1a4e8412005-12-27 08:17:2321
Junio C Hamanofaa1e502008-08-10 03:55:5822A commit object may have any number of parents. With exactly one
23parent, it is an ordinary commit. Having more than one parent makes
24the commit a merge between several lines of history. Initial (root)
25commits have no parents.
Junio C Hamano1a4e8412005-12-27 08:17:2326
27While a tree represents a particular directory state of a working
28directory, a commit represents that state in "time", and explains how
29to get there.
30
31Normally a commit would identify a new "HEAD" state, and while git
32doesn't care where you save the note about that state, in practice we
33tend to just write the result to the file that is pointed at by
34`.git/HEAD`, so that we can always see what the last committed
35state was.
36
37OPTIONS
38-------
39<tree>::
40An existing tree object
41
42-p <parent commit>::
43Each '-p' indicates the id of a parent commit object.
Junio C Hamanoa77a5132007-06-08 16:13:4444
Junio C Hamano1a4e8412005-12-27 08:17:2345
46Commit Information
47------------------
48
49A commit encapsulates:
50
51- all parent object ids
52- author name, email and date
53- committer name and email and the commit time.
54
Junio C Hamano1b11dcb2007-08-18 07:20:5555While parent object ids are provided on the command line, author and
Junio C Hamanoa6387422007-08-25 03:54:2756committer information is taken from the following environment variables,
Junio C Hamano1b11dcb2007-08-18 07:20:5557if set:
Junio C Hamano1a4e8412005-12-27 08:17:2358
59GIT_AUTHOR_NAME
60GIT_AUTHOR_EMAIL
61GIT_AUTHOR_DATE
62GIT_COMMITTER_NAME
63GIT_COMMITTER_EMAIL
Junio C Hamano469d60e2007-04-29 18:30:3464GIT_COMMITTER_DATE
65EMAIL
Junio C Hamano1a4e8412005-12-27 08:17:2366
67(nb "<", ">" and "\n"s are stripped)
68
Junio C Hamano1b11dcb2007-08-18 07:20:5569In case (some of) these environment variables are not set, the information
70is taken from the configuration items user.name and user.email, or, if not
Junio C Hamano5a73f302011-10-14 05:58:3471present, system user name and the hostname used for outgoing mail (taken
72from `/etc/mailname` and falling back to the fully qualified hostname when
73that file does not exist).
Junio C Hamano1a4e8412005-12-27 08:17:2374
Junio C Hamanoc0ea7c62007-07-15 07:19:0675A commit comment is read from stdin. If a changelog
Junio C Hamano1aa40d22010-01-21 17:46:4376entry is not provided via "<" redirection, 'git commit-tree' will just wait
Junio C Hamano1a4e8412005-12-27 08:17:2377for one to be entered and terminated with ^D.
78
Junio C Hamanoae05fee2010-01-08 07:39:4679include::date-formats.txt[]
Junio C Hamano1a4e8412005-12-27 08:17:2380
81Diagnostics
82-----------
83You don't exist. Go away!::
84 The passwd(5) gecos field couldn't be read
85Your parents must have hated you!::
Junio C Hamano37276192008-09-04 00:24:0786 The passwd(5) gecos field is longer than a giant static buffer.
Junio C Hamano1a4e8412005-12-27 08:17:2387Your sysadmin must hate you!::
Junio C Hamano37276192008-09-04 00:24:0788 The passwd(5) name field is longer than a giant static buffer.
Junio C Hamano1a4e8412005-12-27 08:17:2389
Junio C Hamano775a0f42006-12-31 01:19:1490Discussion
91----------
92
93include::i18n.txt[]
94
Junio C Hamano5a73f302011-10-14 05:58:3495FILES
96-----
97/etc/mailname
98
Junio C Hamano9049d912008-05-29 02:09:5099SEE ALSO
Junio C Hamano1a4e8412005-12-27 08:17:23100--------
Junio C Hamano35738e82008-01-07 07:55:46101linkgit:git-write-tree[1]
Junio C Hamano1a4e8412005-12-27 08:17:23102
Junio C Hamano1a4e8412005-12-27 08:17:23103GIT
104---
Junio C Hamanof7c042d2008-06-06 22:50:53105Part of the linkgit:git[1] suite