blob: a2537e179ab4602090df28a0ee7e4dabda36064f [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--------
11'git-commit-tree' <tree> [-p <parent commit>]\* < changelog
12
13DESCRIPTION
14-----------
Junio C Hamanoe58607f2007-01-17 23:27:4515This is usually not what an end user wants to run directly. See
16gitlink:git-commit[1] instead.
17
Junio C Hamano1a4e8412005-12-27 08:17:2318Creates a new commit object based on the provided tree object and
19emits the new commit object id on stdout. If no parent is given then
20it is considered to be an initial tree.
21
22A commit object usually has 1 parent (a commit after a change) or up
23to 16 parents. More than one parent represents a merge of branches
24that led to them.
25
26While a tree represents a particular directory state of a working
27directory, a commit represents that state in "time", and explains how
28to get there.
29
30Normally a commit would identify a new "HEAD" state, and while git
31doesn't care where you save the note about that state, in practice we
32tend to just write the result to the file that is pointed at by
33`.git/HEAD`, so that we can always see what the last committed
34state was.
35
36OPTIONS
37-------
38<tree>::
39An existing tree object
40
41-p <parent commit>::
42Each '-p' indicates the id of a parent commit object.
Junio C Hamanoa77a5132007-06-08 16:13:4443
Junio C Hamano1a4e8412005-12-27 08:17:2344
45Commit Information
46------------------
47
48A commit encapsulates:
49
50- all parent object ids
51- author name, email and date
52- committer name and email and the commit time.
53
Junio C Hamano1b11dcb2007-08-18 07:20:5554While parent object ids are provided on the command line, author and
Junio C Hamanoa6387422007-08-25 03:54:2755committer information is taken from the following environment variables,
Junio C Hamano1b11dcb2007-08-18 07:20:5556if set:
Junio C Hamano1a4e8412005-12-27 08:17:2357
58GIT_AUTHOR_NAME
59GIT_AUTHOR_EMAIL
60GIT_AUTHOR_DATE
61GIT_COMMITTER_NAME
62GIT_COMMITTER_EMAIL
Junio C Hamano469d60e2007-04-29 18:30:3463GIT_COMMITTER_DATE
64EMAIL
Junio C Hamano1a4e8412005-12-27 08:17:2365
66(nb "<", ">" and "\n"s are stripped)
67
Junio C Hamano1b11dcb2007-08-18 07:20:5568In case (some of) these environment variables are not set, the information
69is taken from the configuration items user.name and user.email, or, if not
70present, system user name and fully qualified hostname.
Junio C Hamano1a4e8412005-12-27 08:17:2371
Junio C Hamanoc0ea7c62007-07-15 07:19:0672A commit comment is read from stdin. If a changelog
Junio C Hamano1a4e8412005-12-27 08:17:2373entry is not provided via "<" redirection, "git-commit-tree" will just wait
74for one to be entered and terminated with ^D.
75
76
77Diagnostics
78-----------
79You don't exist. Go away!::
80 The passwd(5) gecos field couldn't be read
81Your parents must have hated you!::
82 The password(5) gecos field is longer than a giant static buffer.
83Your sysadmin must hate you!::
84 The password(5) name field is longer than a giant static buffer.
85
Junio C Hamano775a0f42006-12-31 01:19:1486Discussion
87----------
88
89include::i18n.txt[]
90
Junio C Hamano1a4e8412005-12-27 08:17:2391See Also
92--------
93gitlink:git-write-tree[1]
94
95
96Author
97------
98Written by Linus Torvalds <torvalds@osdl.org>
99
100Documentation
101--------------
102Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
103
104GIT
105---
106Part of the gitlink:git[7] suite