]>
Commit | Line | Data |
---|---|---|
2cf565c5 DG |
1 | git-commit-tree(1) |
2 | ================== | |
2cf565c5 DG |
3 | |
4 | NAME | |
5 | ---- | |
c3f0baac | 6 | git-commit-tree - Create a new commit object |
2cf565c5 DG |
7 | |
8 | ||
9 | SYNOPSIS | |
10 | -------- | |
7791a1d9 | 11 | [verse] |
33e8fc87 | 12 | 'git commit-tree' <tree> [(-p <parent>)...] |
df45cb3e BK |
13 | 'git commit-tree' [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...] |
14 | [(-F <file>)...] <tree> | |
15 | ||
2cf565c5 DG |
16 | |
17 | DESCRIPTION | |
18 | ----------- | |
5cb545fa | 19 | This is usually not what an end user wants to run directly. See |
5162e697 | 20 | linkgit:git-commit[1] instead. |
5cb545fa | 21 | |
2cf565c5 | 22 | Creates a new commit object based on the provided tree object and |
96b8d93a JH |
23 | emits the new commit object id on stdout. The log message is read |
24 | from the standard input, unless `-m` or `-F` options are given. | |
2cf565c5 | 25 | |
cbdeab98 BR |
26 | The `-m` and `-F` options can be given any number of times, in any |
27 | order. The commit log message will be composed in the order in which | |
28 | the options are given. | |
29 | ||
b3bc97cb TR |
30 | A commit object may have any number of parents. With exactly one |
31 | parent, it is an ordinary commit. Having more than one parent makes | |
32 | the commit a merge between several lines of history. Initial (root) | |
33 | commits have no parents. | |
2cf565c5 DG |
34 | |
35 | While a tree represents a particular directory state of a working | |
36 | directory, a commit represents that state in "time", and explains how | |
37 | to get there. | |
38 | ||
2de9b711 | 39 | Normally a commit would identify a new "HEAD" state, and while Git |
2cf565c5 | 40 | doesn't care where you save the note about that state, in practice we |
27dedf0c JH |
41 | tend to just write the result to the file that is pointed at by |
42 | `.git/HEAD`, so that we can always see what the last committed | |
43 | state was. | |
2cf565c5 DG |
44 | |
45 | OPTIONS | |
46 | ------- | |
47 | <tree>:: | |
cbdeab98 | 48 | An existing tree object. |
2cf565c5 | 49 | |
96b8d93a | 50 | -p <parent>:: |
23f8239b | 51 | Each `-p` indicates the id of a parent commit object. |
a6080a0a | 52 | |
96b8d93a | 53 | -m <message>:: |
b4ab1980 | 54 | A paragraph in the commit log message. This can be given more than |
96b8d93a JH |
55 | once and each <message> becomes its own paragraph. |
56 | ||
57 | -F <file>:: | |
58 | Read the commit log message from the given file. Use `-` to read | |
cbdeab98 BR |
59 | from the standard input. This can be given more than once and the |
60 | content of each file becomes its own paragraph. | |
96b8d93a | 61 | |
df45cb3e | 62 | -S[<keyid>]:: |
55ca3f99 | 63 | --gpg-sign[=<keyid>]:: |
2b594bf9 MM |
64 | GPG-sign commits. The `keyid` argument is optional and |
65 | defaults to the committer identity; if specified, it must be | |
66 | stuck to the option without a space. | |
df45cb3e | 67 | |
55ca3f99 | 68 | --no-gpg-sign:: |
66948561 JH |
69 | Do not GPG-sign commit, to countermand a `--gpg-sign` option |
70 | given earlier on the command line. | |
55ca3f99 | 71 | |
2cf565c5 DG |
72 | Commit Information |
73 | ------------------ | |
74 | ||
75 | A commit encapsulates: | |
76 | ||
77 | - all parent object ids | |
78 | - author name, email and date | |
79 | - committer name and email and the commit time. | |
80 | ||
a82830a4 | 81 | A commit comment is read from stdin. If a changelog |
0b444cdb | 82 | entry is not provided via "<" redirection, 'git commit-tree' will just wait |
df8baa42 | 83 | for one to be entered and terminated with ^D. |
2cf565c5 | 84 | |
788070a2 | 85 | include::date-formats.txt[] |
5773c9f2 | 86 | |
5dc7bcc2 JH |
87 | Discussion |
88 | ---------- | |
89 | ||
90 | include::i18n.txt[] | |
91 | ||
8a55caa8 JN |
92 | FILES |
93 | ----- | |
94 | /etc/mailname | |
95 | ||
56ae8df5 | 96 | SEE ALSO |
c1bdacf9 | 97 | -------- |
5162e697 | 98 | linkgit:git-write-tree[1] |
bc94e586 | 99 | linkgit:git-commit[1] |
2cf565c5 | 100 | |
2cf565c5 DG |
101 | GIT |
102 | --- | |
9e1f0a85 | 103 | Part of the linkgit:git[1] suite |