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