1GIT-COMMIT-TREE(1) Git Manual GIT-COMMIT-TREE(1)
2
3
4
6 git-commit-tree - Create a new commit object
7
9 git-commit-tree <tree> [-p <parent commit>]* < changelog
10
12 This is usually not what an end user wants to run directly. See git-
13 commit(1) instead.
14
15 Creates a new commit object based on the provided tree object and emits
16 the new commit object id on stdout. If no parent is given then it is
17 considered to be an initial tree.
18
19 A commit object usually has 1 parent (a commit after a change) or up to
20 16 parents. More than one parent represents a merge of branches that
21 led to them.
22
23 While a tree represents a particular directory state of a working
24 directory, a commit represents that state in "time", and explains how
25 to get there.
26
27 Normally a commit would identify a new "HEAD" state, and while git
28 doesn´t care where you save the note about that state, in practice we
29 tend to just write the result to the file that is pointed at by
30 .git/HEAD, so that we can always see what the last committed state was.
31
33 <tree>
34 An existing tree object
35
36 -p <parent commit>
37 Each -p indicates the id of a parent commit object.
38
40 A commit encapsulates:
41
42
43 · all parent object ids
44
45 · author name, email and date
46
47 · committer name and email and the commit time.
48 While parent object ids are provided on the command line, author and
49 committer information is taken from the following environment
50 variables, if set:
51
52
53 GIT_AUTHOR_NAME
54 GIT_AUTHOR_EMAIL
55 GIT_AUTHOR_DATE
56 GIT_COMMITTER_NAME
57 GIT_COMMITTER_EMAIL
58 GIT_COMMITTER_DATE
59 EMAIL
60 (nb "<", ">" and "\n"s are stripped)
61
62 In case (some of) these environment variables are not set, the
63 information is taken from the configuration items user.name and
64 user.email, or, if not present, system user name and fully qualified
65 hostname.
66
67 A commit comment is read from stdin. If a changelog entry is not
68 provided via "<" redirection, "git-commit-tree" will just wait for one
69 to be entered and terminated with ^D.
70
72 You don´t exist. Go away!
73 The passwd(5) gecos field couldn´t be read
74
75 Your parents must have hated you!
76 The password(5) gecos field is longer than a giant static buffer.
77
78 Your sysadmin must hate you!
79 The password(5) name field is longer than a giant static buffer.
80
82 At the core level, git is character encoding agnostic.
83
84
85 · The pathnames recorded in the index and in the tree objects are
86 treated as uninterpreted sequences of non-NUL bytes. What
87 readdir(2) returns are what are recorded and compared with the data
88 git keeps track of, which in turn are expected to be what lstat(2)
89 and creat(2) accepts. There is no such thing as pathname encoding
90 translation.
91
92 · The contents of the blob objects are uninterpreted sequence of
93 bytes. There is no encoding translation at the core level.
94
95 · The commit log messages are uninterpreted sequence of non-NUL
96 bytes.
97 Although we encourage that the commit log messages are encoded in
98 UTF-8, both the core and git Porcelain are designed not to force UTF-8
99 on projects. If all participants of a particular project find it more
100 convenient to use legacy encodings, git does not forbid it. However,
101 there are a few things to keep in mind.
102
103
104 1. git-commit-tree (hence, git-commit which uses it) issues an
105 warning if the commit log message given to it does not look like a
106 valid UTF-8 string, unless you explicitly say your project uses a
107 legacy encoding. The way to say this is to have i18n.commitencoding
108 in .git/config file, like this:
109
110
111
112 [i18n]
113 commitencoding = ISO-8859-1
114
115 Commit objects created with the above setting record the value of
116 i18n.commitencoding in its encoding header. This is to help other
117 people who look at them later. Lack of this header implies that the
118 commit log message is encoded in UTF-8.
119
120 2. git-log, git-show and friends looks at the encoding header of a
121 commit object, and tries to re-code the log message into UTF-8
122 unless otherwise specified. You can specify the desired output
123 encoding with i18n.logoutputencoding in .git/config file, like
124 this:
125
126
127
128 [i18n]
129 logoutputencoding = ISO-8859-1
130
131 If you do not have this configuration variable, the value of
132 i18n.commitencoding is used instead.
133 Note that we deliberately chose not to re-code the commit log message
134 when a commit is made to force UTF-8 at the commit object level,
135 because re-coding to UTF-8 is not necessarily a reversible operation.
136
138 git-write-tree(1)
139
141 Written by Linus Torvalds <torvalds@osdl.org>
142
144 Documentation by David Greaves, Junio C Hamano and the git-list
145 <git@vger.kernel.org>.
146
148 Part of the git(7) suite
149
150
151
152
153Git 1.5.3.3 10/09/2007 GIT-COMMIT-TREE(1)