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