summaryrefslogtreecommitdiff
path: root/devdocs/git/git-commit-tree.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/git/git-commit-tree.html')
-rw-r--r--devdocs/git/git-commit-tree.html10
1 files changed, 10 insertions, 0 deletions
diff --git a/devdocs/git/git-commit-tree.html b/devdocs/git/git-commit-tree.html
new file mode 100644
index 00000000..c5b04bae
--- /dev/null
+++ b/devdocs/git/git-commit-tree.html
@@ -0,0 +1,10 @@
+<h1>git-commit-tree</h1> <h2 id="_name">Name</h2> <div class="sectionbody"> <p>git-commit-tree - Create a new commit object</p> </div> <h2 id="_synopsis">Synopsis</h2> <div class="sectionbody"> <div class="verseblock"> <pre class="content" data-language="shell">git commit-tree &lt;tree&gt; [(-p &lt;parent&gt;)…​]
+git commit-tree [(-p &lt;parent&gt;)…​] [-S[&lt;keyid&gt;]] [(-m &lt;message&gt;)…​]
+ [(-F &lt;file&gt;)…​] &lt;tree&gt;</pre> </div> </div> <h2 id="_description">Description</h2> <div class="sectionbody"> <p>This is usually not what an end user wants to run directly. See <a href="git-commit">git-commit[1]</a> instead.</p> <p>Creates a new commit object based on the provided tree object and emits the new commit object id on stdout. The log message is read from the standard input, unless <code>-m</code> or <code>-F</code> options are given.</p> <p>The <code>-m</code> and <code>-F</code> options can be given any number of times, in any order. The commit log message will be composed in the order in which the options are given.</p> <p>A commit object may have any number of parents. With exactly one parent, it is an ordinary commit. Having more than one parent makes the commit a merge between several lines of history. Initial (root) commits have no parents.</p> <p>While a tree represents a particular directory state of a working directory, a commit represents that state in "time", and explains how to get there.</p> <p>Normally a commit would identify a new "HEAD" state, and while Git doesn’t care where you save the note about that state, in practice we tend to just write the result to the file that is pointed at by <code>.git/HEAD</code>, so that we can always see what the last committed state was.</p> </div> <h2 id="_options">Options</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-commit-tree.txt-lttreegt"> &lt;tree&gt; </dt> <dd> <p>An existing tree object.</p> </dd> <dt class="hdlist1" id="Documentation/git-commit-tree.txt--pltparentgt"> -p &lt;parent&gt; </dt> <dd> <p>Each <code>-p</code> indicates the id of a parent commit object.</p> </dd> <dt class="hdlist1" id="Documentation/git-commit-tree.txt--mltmessagegt"> -m &lt;message&gt; </dt> <dd> <p>A paragraph in the commit log message. This can be given more than once and each &lt;message&gt; becomes its own paragraph.</p> </dd> <dt class="hdlist1" id="Documentation/git-commit-tree.txt--Fltfilegt"> -F &lt;file&gt; </dt> <dd> <p>Read the commit log message from the given file. Use <code>-</code> to read from the standard input. This can be given more than once and the content of each file becomes its own paragraph.</p> </dd> <dt class="hdlist1" id="Documentation/git-commit-tree.txt--Sltkeyidgt"> -S[&lt;keyid&gt;] </dt> <dt class="hdlist1" id="Documentation/git-commit-tree.txt---gpg-signltkeyidgt"> --gpg-sign[=&lt;keyid&gt;] </dt> <dt class="hdlist1" id="Documentation/git-commit-tree.txt---no-gpg-sign"> --no-gpg-sign </dt> <dd> <p>GPG-sign commits. The <code>keyid</code> argument is optional and defaults to the committer identity; if specified, it must be stuck to the option without a space. <code>--no-gpg-sign</code> is useful to countermand a <code>--gpg-sign</code> option given earlier on the command line.</p> </dd> </dl> </div> </div> <h2 id="_commit_information">Commit information</h2> <div class="sectionbody"> <p>A commit encapsulates:</p> <div class="ulist"> <ul> <li> <p>all parent object ids</p> </li> <li> <p>author name, email and date</p> </li> <li> <p>committer name and email and the commit time.</p> </li> </ul> </div> <p>A commit comment is read from stdin. If a changelog entry is not provided via "&lt;" redirection, <code>git commit-tree</code> will just wait for one to be entered and terminated with ^D.</p> </div> <h2 id="_date_formats">Date formats</h2> <div class="sectionbody"> <p>The <code>GIT_AUTHOR_DATE</code> and <code>GIT_COMMITTER_DATE</code> environment variables support the following date formats:</p> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-commit-tree.txt-Gitinternalformat"> Git internal format </dt> <dd> <p>It is <code>&lt;unix-timestamp&gt; &lt;time-zone-offset&gt;</code>, where <code>&lt;unix-timestamp&gt;</code> is the number of seconds since the UNIX epoch. <code>&lt;time-zone-offset&gt;</code> is a positive or negative offset from UTC. For example CET (which is 1 hour ahead of UTC) is <code>+0100</code>.</p> </dd> <dt class="hdlist1" id="Documentation/git-commit-tree.txt-RFC2822"> RFC 2822 </dt> <dd> <p>The standard email format as described by RFC 2822, for example <code>Thu, 07 Apr 2005 22:13:13 +0200</code>.</p> </dd> <dt class="hdlist1" id="Documentation/git-commit-tree.txt-ISO8601"> ISO 8601 </dt> <dd> <p>Time and date specified by the ISO 8601 standard, for example <code>2005-04-07T22:13:13</code>. The parser accepts a space instead of the <code>T</code> character as well. Fractional parts of a second will be ignored, for example <code>2005-04-07T22:13:13.019</code> will be treated as <code>2005-04-07T22:13:13</code>.</p> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <div class="title">Note</div> </td> <td class="content"> In addition, the date part is accepted in the following formats: <code>YYYY.MM.DD</code>, <code>MM/DD/YYYY</code> and <code>DD.MM.YYYY</code>. </td> </tr> </table> </div> </dd> </dl> </div> </div> <h2 id="_discussion">Discussion</h2> <div class="sectionbody"> <p>Git is to some extent character encoding agnostic.</p> <div class="ulist"> <ul> <li> <p>The contents of the blob objects are uninterpreted sequences of bytes. There is no encoding translation at the core level.</p> </li> <li> <p>Path names are encoded in UTF-8 normalization form C. This applies to tree objects, the index file, ref names, as well as path names in command line arguments, environment variables and config files (<code>.git/config</code> (see <a href="git-config">git-config[1]</a>), <a href="gitignore">gitignore[5]</a>, <a href="gitattributes">gitattributes[5]</a> and <a href="gitmodules">gitmodules[5]</a>).</p> <p>Note that Git at the core level treats path names simply as sequences of non-NUL bytes, there are no path name encoding conversions (except on Mac and Windows). Therefore, using non-ASCII path names will mostly work even on platforms and file systems that use legacy extended ASCII encodings. However, repositories created on such systems will not work properly on UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa. Additionally, many Git-based tools simply assume path names to be UTF-8 and will fail to display other encodings correctly.</p> </li> <li> <p>Commit log messages are typically encoded in UTF-8, but other extended ASCII encodings are also supported. This includes ISO-8859-x, CP125x and many others, but <code>not</code> UTF-16/32, EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5, EUC-x, CP9xx etc.).</p> </li> </ul> </div> <p>Although we encourage that the commit log messages are encoded in UTF-8, both the core and Git Porcelain are designed not to force UTF-8 on projects. If all participants of a particular project find it more convenient to use legacy encodings, Git does not forbid it. However, there are a few things to keep in mind.</p> <div class="olist arabic"> <ol class="arabic"> <li> <p><code>git commit</code> and <code>git commit-tree</code> issue a warning if the commit log message given to it does not look like a valid UTF-8 string, unless you explicitly say your project uses a legacy encoding. The way to say this is to have <code>i18n.commitEncoding</code> in <code>.git/config</code> file, like this:</p> <div class="listingblock"> <div class="content"> <pre>[i18n]
+ commitEncoding = ISO-8859-1</pre> </div> </div> <p>Commit objects created with the above setting record the value of <code>i18n.commitEncoding</code> in their <code>encoding</code> header. This is to help other people who look at them later. Lack of this header implies that the commit log message is encoded in UTF-8.</p> </li> <li> <p><code>git log</code>, <code>git show</code>, <code>git blame</code> and friends look at the <code>encoding</code> header of a commit object, and try to re-code the log message into UTF-8 unless otherwise specified. You can specify the desired output encoding with <code>i18n.logOutputEncoding</code> in <code>.git/config</code> file, like this:</p> <div class="listingblock"> <div class="content"> <pre>[i18n]
+ logOutputEncoding = ISO-8859-1</pre> </div> </div> <p>If you do not have this configuration variable, the value of <code>i18n.commitEncoding</code> is used instead.</p> </li> </ol> </div> <p>Note that we deliberately chose not to re-code the commit log message when a commit is made to force UTF-8 at the commit object level, because re-coding to UTF-8 is not necessarily a reversible operation.</p> </div> <h2 id="_files">Files</h2> <div class="sectionbody"> <p>/etc/mailname</p> </div> <h2 id="_see_also">See also</h2> <div class="sectionbody"> <p><a href="git-write-tree">git-write-tree[1]</a> <a href="git-commit">git-commit[1]</a></p> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2012&ndash;2024 Scott Chacon and others<br>Licensed under the MIT License.<br>
+ <a href="https://git-scm.com/docs/git-commit-tree" class="_attribution-link">https://git-scm.com/docs/git-commit-tree</a>
+ </p>
+</div>