]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-commit-tree.txt
Documentation: do not blindly run 'cat' .git/HEAD, or echo into it.
[thirdparty/git.git] / Documentation / git-commit-tree.txt
CommitLineData
2cf565c5
DG
1git-commit-tree(1)
2==================
2cf565c5
DG
3
4NAME
5----
6git-commit-tree - Creates a new commit object
7
8
9SYNOPSIS
10--------
7acab8f1 11'git-commit-tree' <tree> [-p <parent commit>]\* < changelog
2cf565c5
DG
12
13DESCRIPTION
14-----------
15Creates a new commit object based on the provided tree object and
16emits the new commit object id on stdout. If no parent is given then
17it is considered to be an initial tree.
18
19A commit object usually has 1 parent (a commit after a change) or up
20to 16 parents. More than one parent represents a merge of branches
21that led to them.
22
23While a tree represents a particular directory state of a working
24directory, a commit represents that state in "time", and explains how
25to get there.
26
27Normally a commit would identify a new "HEAD" state, and while git
28doesn't care where you save the note about that state, in practice we
cd0a781c
JH
29tend 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
31state was.
2cf565c5
DG
32
33OPTIONS
34-------
35<tree>::
36 An existing tree object
37
38-p <parent commit>::
f73ae1fc 39 Each '-p' indicates the id of a parent commit object.
2cf565c5
DG
40
41
42Commit Information
43------------------
44
45A commit encapsulates:
46
47- all parent object ids
48- author name, email and date
49- committer name and email and the commit time.
50
51If not provided, "git-commit-tree" uses your name, hostname and domain to
5773c9f2
JH
52provide author and committer info. This can be overridden by
53either `.git/config` file, or using the following environment variables.
2cf565c5
DG
54
55 GIT_AUTHOR_NAME
56 GIT_AUTHOR_EMAIL
57 GIT_AUTHOR_DATE
58 GIT_COMMITTER_NAME
59 GIT_COMMITTER_EMAIL
60
df8baa42 61(nb "<", ">" and "\n"s are stripped)
2cf565c5 62
5773c9f2
JH
63In `.git/config` file, the following items are used:
64
65 [user]
66 name = "Your Name"
67 email = "your@email.address.xz"
68
2cf565c5 69A commit comment is read from stdin (max 999 chars). If a changelog
df8baa42
JF
70entry is not provided via "<" redirection, "git-commit-tree" will just wait
71for one to be entered and terminated with ^D.
2cf565c5 72
5773c9f2 73
c1bdacf9
DG
74Diagnostics
75-----------
76You don't exist. Go away!::
77 The passwd(5) gecos field couldn't be read
9153368d
EB
78Your parents must have hated you!::
79 The password(5) gecos field is longer than a giant static buffer.
80Your sysadmin must hate you!::
81 The password(5) name field is longer than a giant static buffer.
c1bdacf9
DG
82
83See Also
84--------
a7154e91 85gitlink:git-write-tree[1]
2cf565c5
DG
86
87
88Author
89------
90Written by Linus Torvalds <torvalds@osdl.org>
91
92Documentation
93--------------
94Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
95
96GIT
97---
a7154e91 98Part of the gitlink:git[7] suite
2cf565c5 99