]>
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] |
0adda936 | 12 | 'git commit-tree' <tree> [(-p <parent commit>)...] < changelog |
2cf565c5 DG |
13 | |
14 | DESCRIPTION | |
15 | ----------- | |
5cb545fa | 16 | This is usually not what an end user wants to run directly. See |
5162e697 | 17 | linkgit:git-commit[1] instead. |
5cb545fa | 18 | |
2cf565c5 | 19 | Creates a new commit object based on the provided tree object and |
b3bc97cb | 20 | emits the new commit object id on stdout. |
2cf565c5 | 21 | |
b3bc97cb TR |
22 | A commit object may have any number of parents. With exactly one |
23 | parent, it is an ordinary commit. Having more than one parent makes | |
24 | the commit a merge between several lines of history. Initial (root) | |
25 | commits have no parents. | |
2cf565c5 DG |
26 | |
27 | While a tree represents a particular directory state of a working | |
28 | directory, a commit represents that state in "time", and explains how | |
29 | to get there. | |
30 | ||
31 | Normally a commit would identify a new "HEAD" state, and while git | |
32 | doesn't care where you save the note about that state, in practice we | |
27dedf0c JH |
33 | tend 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 | |
35 | state was. | |
2cf565c5 DG |
36 | |
37 | OPTIONS | |
38 | ------- | |
39 | <tree>:: | |
40 | An existing tree object | |
41 | ||
42 | -p <parent commit>:: | |
f73ae1fc | 43 | Each '-p' indicates the id of a parent commit object. |
a6080a0a | 44 | |
2cf565c5 DG |
45 | |
46 | Commit Information | |
47 | ------------------ | |
48 | ||
49 | A commit encapsulates: | |
50 | ||
51 | - all parent object ids | |
52 | - author name, email and date | |
53 | - committer name and email and the commit time. | |
54 | ||
0734d265 | 55 | While parent object ids are provided on the command line, author and |
02783075 | 56 | committer information is taken from the following environment variables, |
0734d265 | 57 | if set: |
2cf565c5 DG |
58 | |
59 | GIT_AUTHOR_NAME | |
60 | GIT_AUTHOR_EMAIL | |
61 | GIT_AUTHOR_DATE | |
62 | GIT_COMMITTER_NAME | |
63 | GIT_COMMITTER_EMAIL | |
4e58bf97 | 64 | GIT_COMMITTER_DATE |
28a94f88 | 65 | |
2cf565c5 | 66 | |
df8baa42 | 67 | (nb "<", ">" and "\n"s are stripped) |
2cf565c5 | 68 | |
0734d265 MH |
69 | In case (some of) these environment variables are not set, the information |
70 | is taken from the configuration items user.name and user.email, or, if not | |
8a55caa8 JN |
71 | present, system user name and the hostname used for outgoing mail (taken |
72 | from `/etc/mailname` and falling back to the fully qualified hostname when | |
73 | that file does not exist). | |
5773c9f2 | 74 | |
a82830a4 | 75 | A commit comment is read from stdin. If a changelog |
0b444cdb | 76 | entry is not provided via "<" redirection, 'git commit-tree' will just wait |
df8baa42 | 77 | for one to be entered and terminated with ^D. |
2cf565c5 | 78 | |
788070a2 | 79 | include::date-formats.txt[] |
5773c9f2 | 80 | |
c1bdacf9 DG |
81 | Diagnostics |
82 | ----------- | |
83 | You don't exist. Go away!:: | |
84 | The passwd(5) gecos field couldn't be read | |
9153368d | 85 | Your parents must have hated you!:: |
73bae1dc | 86 | The passwd(5) gecos field is longer than a giant static buffer. |
9153368d | 87 | Your sysadmin must hate you!:: |
73bae1dc | 88 | The passwd(5) name field is longer than a giant static buffer. |
c1bdacf9 | 89 | |
5dc7bcc2 JH |
90 | Discussion |
91 | ---------- | |
92 | ||
93 | include::i18n.txt[] | |
94 | ||
8a55caa8 JN |
95 | FILES |
96 | ----- | |
97 | /etc/mailname | |
98 | ||
56ae8df5 | 99 | SEE ALSO |
c1bdacf9 | 100 | -------- |
5162e697 | 101 | linkgit:git-write-tree[1] |
2cf565c5 | 102 | |
2cf565c5 DG |
103 | GIT |
104 | --- | |
9e1f0a85 | 105 | Part of the linkgit:git[1] suite |