Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-commit-tree(1) |
| 2 | ================== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 7c73c66 | 2007-01-19 00:37:50 | [diff] [blame] | 6 | git-commit-tree - Create a new commit object |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
| 11 | 'git-commit-tree' <tree> [-p <parent commit>]\* < changelog |
| 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
Junio C Hamano | e58607f | 2007-01-17 23:27:45 | [diff] [blame] | 15 | This is usually not what an end user wants to run directly. See |
| 16 | gitlink:git-commit[1] instead. |
| 17 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 18 | Creates a new commit object based on the provided tree object and |
| 19 | emits the new commit object id on stdout. If no parent is given then |
| 20 | it is considered to be an initial tree. |
| 21 | |
| 22 | A commit object usually has 1 parent (a commit after a change) or up |
| 23 | to 16 parents. More than one parent represents a merge of branches |
| 24 | that led to them. |
| 25 | |
| 26 | While a tree represents a particular directory state of a working |
| 27 | directory, a commit represents that state in "time", and explains how |
| 28 | to get there. |
| 29 | |
| 30 | Normally a commit would identify a new "HEAD" state, and while git |
| 31 | doesn't care where you save the note about that state, in practice we |
| 32 | tend to just write the result to the file that is pointed at by |
| 33 | `.git/HEAD`, so that we can always see what the last committed |
| 34 | state was. |
| 35 | |
| 36 | OPTIONS |
| 37 | ------- |
| 38 | <tree>:: |
| 39 | An existing tree object |
| 40 | |
| 41 | -p <parent commit>:: |
| 42 | Each '-p' indicates the id of a parent commit object. |
Junio C Hamano | a77a513 | 2007-06-08 16:13:44 | [diff] [blame] | 43 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 44 | |
| 45 | Commit Information |
| 46 | ------------------ |
| 47 | |
| 48 | A commit encapsulates: |
| 49 | |
| 50 | - all parent object ids |
| 51 | - author name, email and date |
| 52 | - committer name and email and the commit time. |
| 53 | |
Junio C Hamano | 1b11dcb | 2007-08-18 07:20:55 | [diff] [blame] | 54 | While parent object ids are provided on the command line, author and |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame^] | 55 | committer information is taken from the following environment variables, |
Junio C Hamano | 1b11dcb | 2007-08-18 07:20:55 | [diff] [blame] | 56 | if set: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 57 | |
| 58 | GIT_AUTHOR_NAME |
| 59 | GIT_AUTHOR_EMAIL |
| 60 | GIT_AUTHOR_DATE |
| 61 | GIT_COMMITTER_NAME |
| 62 | GIT_COMMITTER_EMAIL |
Junio C Hamano | 469d60e | 2007-04-29 18:30:34 | [diff] [blame] | 63 | GIT_COMMITTER_DATE |
| 64 | EMAIL |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 65 | |
| 66 | (nb "<", ">" and "\n"s are stripped) |
| 67 | |
Junio C Hamano | 1b11dcb | 2007-08-18 07:20:55 | [diff] [blame] | 68 | In case (some of) these environment variables are not set, the information |
| 69 | is taken from the configuration items user.name and user.email, or, if not |
| 70 | present, system user name and fully qualified hostname. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 71 | |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 72 | A commit comment is read from stdin. If a changelog |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 73 | entry is not provided via "<" redirection, "git-commit-tree" will just wait |
| 74 | for one to be entered and terminated with ^D. |
| 75 | |
| 76 | |
| 77 | Diagnostics |
| 78 | ----------- |
| 79 | You don't exist. Go away!:: |
| 80 | The passwd(5) gecos field couldn't be read |
| 81 | Your parents must have hated you!:: |
| 82 | The password(5) gecos field is longer than a giant static buffer. |
| 83 | Your sysadmin must hate you!:: |
| 84 | The password(5) name field is longer than a giant static buffer. |
| 85 | |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 86 | Discussion |
| 87 | ---------- |
| 88 | |
| 89 | include::i18n.txt[] |
| 90 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 91 | See Also |
| 92 | -------- |
| 93 | gitlink:git-write-tree[1] |
| 94 | |
| 95 | |
| 96 | Author |
| 97 | ------ |
| 98 | Written by Linus Torvalds <torvalds@osdl.org> |
| 99 | |
| 100 | Documentation |
| 101 | -------------- |
| 102 | Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>. |
| 103 | |
| 104 | GIT |
| 105 | --- |
| 106 | Part of the gitlink:git[7] suite |