builtin/blame: destroy initialized commit_info only
[git.git] / Documentation / git-commit-tree.txt
blobcafdc9642d312776b0122c4d010a9e9246bad8ff
1 git-commit-tree(1)
2 ==================
4 NAME
5 ----
6 git-commit-tree - Create a new commit object
9 SYNOPSIS
10 --------
11 [verse]
12 'git commit-tree' <tree> [(-p <parent>)...] < changelog
13 'git commit-tree' [(-p <parent>)...] [-S[<keyid>]] [(-m <message>)...]
14                   [(-F <file>)...] <tree>
17 DESCRIPTION
18 -----------
19 This is usually not what an end user wants to run directly.  See
20 linkgit:git-commit[1] instead.
22 Creates a new commit object based on the provided tree object and
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.
26 A commit object may have any number of parents. With exactly one
27 parent, it is an ordinary commit. Having more than one parent makes
28 the commit a merge between several lines of history. Initial (root)
29 commits have no parents.
31 While a tree represents a particular directory state of a working
32 directory, a commit represents that state in "time", and explains how
33 to get there.
35 Normally a commit would identify a new "HEAD" state, and while Git
36 doesn't care where you save the note about that state, in practice we
37 tend to just write the result to the file that is pointed at by
38 `.git/HEAD`, so that we can always see what the last committed
39 state was.
41 OPTIONS
42 -------
43 <tree>::
44         An existing tree object
46 -p <parent>::
47         Each '-p' indicates the id of a parent commit object.
49 -m <message>::
50         A paragraph in the commit log message. This can be given more than
51         once and each <message> becomes its own paragraph.
53 -F <file>::
54         Read the commit log message from the given file. Use `-` to read
55         from the standard input.
57 -S[<keyid>]::
58         GPG-sign commit.
61 Commit Information
62 ------------------
64 A commit encapsulates:
66 - all parent object ids
67 - author name, email and date
68 - committer name and email and the commit time.
70 While parent object ids are provided on the command line, author and
71 committer information is taken from the following environment variables,
72 if set:
74         GIT_AUTHOR_NAME
75         GIT_AUTHOR_EMAIL
76         GIT_AUTHOR_DATE
77         GIT_COMMITTER_NAME
78         GIT_COMMITTER_EMAIL
79         GIT_COMMITTER_DATE
81 (nb "<", ">" and "\n"s are stripped)
83 In case (some of) these environment variables are not set, the information
84 is taken from the configuration items user.name and user.email, or, if not
85 present, the environment variable EMAIL, or, if that is not set,
86 system user name and the hostname used for outgoing mail (taken
87 from `/etc/mailname` and falling back to the fully qualified hostname when
88 that file does not exist).
90 A commit comment is read from stdin. If a changelog
91 entry is not provided via "<" redirection, 'git commit-tree' will just wait
92 for one to be entered and terminated with ^D.
94 include::date-formats.txt[]
96 Discussion
97 ----------
99 include::i18n.txt[]
101 FILES
102 -----
103 /etc/mailname
105 SEE ALSO
106 --------
107 linkgit:git-write-tree[1]
111 Part of the linkgit:git[1] suite