Autogenerated HTML docs for v2.45.0-31-gd4cc1
[git-htmldocs.git] / git-commit-tree.txt
blob2e2c5810983a89a22e3280a276b5e8fd1509c670
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>)...]
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 The `-m` and `-F` options can be given any number of times, in any
27 order. The commit log message will be composed in the order in which
28 the options are given.
30 A commit object may have any number of parents. With exactly one
31 parent, it is an ordinary commit. Having more than one parent makes
32 the commit a merge between several lines of history. Initial (root)
33 commits have no parents.
35 While a tree represents a particular directory state of a working
36 directory, a commit represents that state in "time", and explains how
37 to get there.
39 Normally a commit would identify a new "HEAD" state, and while Git
40 doesn't care where you save the note about that state, in practice we
41 tend to just write the result to the file that is pointed at by
42 `.git/HEAD`, so that we can always see what the last committed
43 state was.
45 OPTIONS
46 -------
47 <tree>::
48         An existing tree object.
50 -p <parent>::
51         Each `-p` indicates the id of a parent commit object.
53 -m <message>::
54         A paragraph in the commit log message. This can be given more than
55         once and each <message> becomes its own paragraph.
57 -F <file>::
58         Read the commit log message from the given file. Use `-` to read
59         from the standard input. This can be given more than once and the
60         content of each file becomes its own paragraph.
62 -S[<keyid>]::
63 --gpg-sign[=<keyid>]::
64 --no-gpg-sign::
65         GPG-sign commits. The `keyid` argument is optional and
66         defaults to the committer identity; if specified, it must be
67         stuck to the option without a space. `--no-gpg-sign` is useful to
68         countermand a `--gpg-sign` option given earlier on the command line.
70 Commit Information
71 ------------------
73 A commit encapsulates:
75 - all parent object ids
76 - author name, email and date
77 - committer name and email and the commit time.
79 A commit comment is read from stdin. If a changelog
80 entry is not provided via "<" redirection, 'git commit-tree' will just wait
81 for one to be entered and terminated with ^D.
83 include::date-formats.txt[]
85 Discussion
86 ----------
88 include::i18n.txt[]
90 FILES
91 -----
92 /etc/mailname
94 SEE ALSO
95 --------
96 linkgit:git-write-tree[1]
97 linkgit:git-commit[1]
99 GIT
101 Part of the linkgit:git[1] suite