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