]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-commit-tree.txt
Documentation: explain optional arguments better
[thirdparty/git.git] / Documentation / git-commit-tree.txt
CommitLineData
2cf565c5
DG
1git-commit-tree(1)
2==================
2cf565c5
DG
3
4NAME
5----
c3f0baac 6git-commit-tree - Create a new commit object
2cf565c5
DG
7
8
9SYNOPSIS
10--------
7791a1d9 11[verse]
96b8d93a 12'git commit-tree' <tree> [(-p <parent>)...] < changelog
df45cb3e
BK
13'git commit-tree' [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]
14 [(-F <file>)...] <tree>
15
2cf565c5
DG
16
17DESCRIPTION
18-----------
5cb545fa 19This is usually not what an end user wants to run directly. See
5162e697 20linkgit:git-commit[1] instead.
5cb545fa 21
2cf565c5 22Creates a new commit object based on the provided tree object and
96b8d93a
JH
23emits the new commit object id on stdout. The log message is read
24from the standard input, unless `-m` or `-F` options are given.
2cf565c5 25
b3bc97cb
TR
26A 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.
2cf565c5
DG
30
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
2de9b711 35Normally a commit would identify a new "HEAD" state, and while Git
2cf565c5 36doesn't care where you save the note about that state, in practice we
27dedf0c
JH
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.
2cf565c5
DG
40
41OPTIONS
42-------
43<tree>::
44 An existing tree object
45
96b8d93a 46-p <parent>::
f73ae1fc 47 Each '-p' indicates the id of a parent commit object.
a6080a0a 48
96b8d93a 49-m <message>::
b4ab1980 50 A paragraph in the commit log message. This can be given more than
96b8d93a
JH
51 once and each <message> becomes its own paragraph.
52
53-F <file>::
54 Read the commit log message from the given file. Use `-` to read
55 from the standard input.
56
df45cb3e 57-S[<keyid>]::
55ca3f99 58--gpg-sign[=<keyid>]::
2b594bf9
MM
59 GPG-sign commits. The `keyid` argument is optional and
60 defaults to the committer identity; if specified, it must be
61 stuck to the option without a space.
df45cb3e 62
55ca3f99 63--no-gpg-sign::
da0005b8 64 Countermand `commit.gpgSign` configuration variable that is
55ca3f99
JH
65 set to force each and every commit to be signed.
66
2cf565c5
DG
67
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
0734d265 77While parent object ids are provided on the command line, author and
02783075 78committer information is taken from the following environment variables,
0734d265 79if set:
2cf565c5
DG
80
81 GIT_AUTHOR_NAME
82 GIT_AUTHOR_EMAIL
83 GIT_AUTHOR_DATE
84 GIT_COMMITTER_NAME
85 GIT_COMMITTER_EMAIL
4e58bf97 86 GIT_COMMITTER_DATE
2cf565c5 87
df8baa42 88(nb "<", ">" and "\n"s are stripped)
2cf565c5 89
0734d265
MH
90In 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
be33414b
PE
92present, the environment variable EMAIL, or, if that is not set,
93system user name and the hostname used for outgoing mail (taken
8a55caa8
JN
94from `/etc/mailname` and falling back to the fully qualified hostname when
95that file does not exist).
5773c9f2 96
a82830a4 97A commit comment is read from stdin. If a changelog
0b444cdb 98entry is not provided via "<" redirection, 'git commit-tree' will just wait
df8baa42 99for one to be entered and terminated with ^D.
2cf565c5 100
788070a2 101include::date-formats.txt[]
5773c9f2 102
5dc7bcc2
JH
103Discussion
104----------
105
106include::i18n.txt[]
107
8a55caa8
JN
108FILES
109-----
110/etc/mailname
111
56ae8df5 112SEE ALSO
c1bdacf9 113--------
5162e697 114linkgit:git-write-tree[1]
2cf565c5 115
2cf565c5
DG
116GIT
117---
9e1f0a85 118Part of the linkgit:git[1] suite