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 | -------- |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 11 | [verse] |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 12 | 'git commit-tree' <tree> [(-p <parent commit>)...] < changelog |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 13 | |
| 14 | DESCRIPTION |
| 15 | ----------- |
Junio C Hamano | e58607f | 2007-01-17 23:27:45 | [diff] [blame] | 16 | This is usually not what an end user wants to run directly. See |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 17 | linkgit:git-commit[1] instead. |
Junio C Hamano | e58607f | 2007-01-17 23:27:45 | [diff] [blame] | 18 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 19 | Creates a new commit object based on the provided tree object and |
Junio C Hamano | faa1e50 | 2008-08-10 03:55:58 | [diff] [blame] | 20 | emits the new commit object id on stdout. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 21 | |
Junio C Hamano | faa1e50 | 2008-08-10 03:55:58 | [diff] [blame] | 22 | A commit object may have any number of parents. With exactly one |
| 23 | parent, it is an ordinary commit. Having more than one parent makes |
| 24 | the commit a merge between several lines of history. Initial (root) |
| 25 | commits have no parents. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 26 | |
| 27 | While a tree represents a particular directory state of a working |
| 28 | directory, a commit represents that state in "time", and explains how |
| 29 | to get there. |
| 30 | |
| 31 | Normally a commit would identify a new "HEAD" state, and while git |
| 32 | doesn't care where you save the note about that state, in practice we |
| 33 | tend to just write the result to the file that is pointed at by |
| 34 | `.git/HEAD`, so that we can always see what the last committed |
| 35 | state was. |
| 36 | |
| 37 | OPTIONS |
| 38 | ------- |
| 39 | <tree>:: |
| 40 | An existing tree object |
| 41 | |
| 42 | -p <parent commit>:: |
| 43 | Each '-p' indicates the id of a parent commit object. |
Junio C Hamano | a77a513 | 2007-06-08 16:13:44 | [diff] [blame] | 44 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 45 | |
| 46 | Commit Information |
| 47 | ------------------ |
| 48 | |
| 49 | A commit encapsulates: |
| 50 | |
| 51 | - all parent object ids |
| 52 | - author name, email and date |
| 53 | - committer name and email and the commit time. |
| 54 | |
Junio C Hamano | 1b11dcb | 2007-08-18 07:20:55 | [diff] [blame] | 55 | While parent object ids are provided on the command line, author and |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 56 | committer information is taken from the following environment variables, |
Junio C Hamano | 1b11dcb | 2007-08-18 07:20:55 | [diff] [blame] | 57 | if set: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 58 | |
| 59 | GIT_AUTHOR_NAME |
| 60 | GIT_AUTHOR_EMAIL |
| 61 | GIT_AUTHOR_DATE |
| 62 | GIT_COMMITTER_NAME |
| 63 | GIT_COMMITTER_EMAIL |
Junio C Hamano | 469d60e | 2007-04-29 18:30:34 | [diff] [blame] | 64 | GIT_COMMITTER_DATE |
| 65 | EMAIL |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 66 | |
| 67 | (nb "<", ">" and "\n"s are stripped) |
| 68 | |
Junio C Hamano | 1b11dcb | 2007-08-18 07:20:55 | [diff] [blame] | 69 | In case (some of) these environment variables are not set, the information |
| 70 | is taken from the configuration items user.name and user.email, or, if not |
Junio C Hamano | 5a73f30 | 2011-10-14 05:58:34 | [diff] [blame^] | 71 | present, system user name and the hostname used for outgoing mail (taken |
| 72 | from `/etc/mailname` and falling back to the fully qualified hostname when |
| 73 | that file does not exist). |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 74 | |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 75 | A commit comment is read from stdin. If a changelog |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 76 | entry is not provided via "<" redirection, 'git commit-tree' will just wait |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 77 | for one to be entered and terminated with ^D. |
| 78 | |
Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 79 | include::date-formats.txt[] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 80 | |
| 81 | Diagnostics |
| 82 | ----------- |
| 83 | You don't exist. Go away!:: |
| 84 | The passwd(5) gecos field couldn't be read |
| 85 | Your parents must have hated you!:: |
Junio C Hamano | 3727619 | 2008-09-04 00:24:07 | [diff] [blame] | 86 | The passwd(5) gecos field is longer than a giant static buffer. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 87 | Your sysadmin must hate you!:: |
Junio C Hamano | 3727619 | 2008-09-04 00:24:07 | [diff] [blame] | 88 | The passwd(5) name field is longer than a giant static buffer. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 89 | |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 90 | Discussion |
| 91 | ---------- |
| 92 | |
| 93 | include::i18n.txt[] |
| 94 | |
Junio C Hamano | 5a73f30 | 2011-10-14 05:58:34 | [diff] [blame^] | 95 | FILES |
| 96 | ----- |
| 97 | /etc/mailname |
| 98 | |
Junio C Hamano | 9049d91 | 2008-05-29 02:09:50 | [diff] [blame] | 99 | SEE ALSO |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 100 | -------- |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 101 | linkgit:git-write-tree[1] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 102 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 103 | GIT |
| 104 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 105 | Part of the linkgit:git[1] suite |