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