commit-tree

NAME

git-commit-tree - Create a new commit objectgit-commit-tree - 新しいコミットオブジェクトを作成する

SYNOPSIS概要

git commit-tree <tree> [(-p <parent>)…​]
git commit-tree [(-p <parent>)…​] [-S[<keyid>]] [(-m <message>)…​]
		  [(-F <file>)…​] <tree>

DESCRIPTION説明

This is usually not what an end user wants to run directly. See git-commit[1] instead.これは通常、エンドユーザーが直接実行したいものではありません。代わりにgit-commit [1]を見てください。

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 -m or -F options are given.提供されたツリーオブジェクトに基づいて新しいコミットオブジェクトを作成し、新しいコミットオブジェクトIDを標準出力に発行します。しない限り、ログメッセージは、標準入力から読み取られ-m、または-Fオプションが与えられています。

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.コミットオブジェクトは、任意の数の親を持つことができます。ちょうど1人の親にとって、それは普通のコミットです。複数の親を持つことで、コミットは複数行の履歴間でマージされます。初期(ルート)コミットには親がいません。

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.ツリーは作業ディレクトリの特定のディレクトリ状態を表しますが、コミットはその状態を「時間」で表し、そこに到達する方法を説明します。

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 .git/HEAD, so that we can always see what the last committed state was.通常、新しい「HEAD」状態を識別し、そしてあなたがその状態に関するメモを保存する場所をGitが気にしませんが、実際には我々だけが指すされたファイルに結果を書き込みする傾向がコミット.git/HEAD私たちができるように、最後にコミットした状態が何であるかを常に確認してください。

OPTIONSオプション

<tree> <ツリー>

An existing tree object既存のツリーオブジェクト

-p <parent> -p <親>

Each -p indicates the id of a parent commit object.それぞれ-pが親コミットオブジェクトのIDを示します。

-m <message> -m <メッセージ>

A paragraph in the commit log message. This can be given more than once and each <message> becomes its own paragraph.コミットログメッセージ内の段落。これは複数回指定することができ、各<message>は独自の段落になります。

-F <file> -F <ファイル>

Read the commit log message from the given file. Use - to read from the standard input.与えられたファイルからコミットログメッセージを読みます。-標準入力から読み込むために使用します。

-S[<keyid>] -S [<keyid>]
--gpg-sign[=<keyid>] --gpg-sign [= <keyid>]

GPG-sign commits. The keyid argument is optional and defaults to the committer identity; if specified, it must be stuck to the option without a space.GPG-signがコミットします。keyid引数はコミッターのアイデンティティオプションで、デフォルトです。指定した場合は、スペースなしでオプションに固定する必要があります。

--no-gpg-sign

Do not GPG-sign commit, to countermand a --gpg-sign option given earlier on the command line.--gpg-signコマンドラインで前に指定したオプションに対抗するために、コミットをGPG署名しないでください。

Commit Informationコミット情報

A commit encapsulates:コミットは次のものをカプセル化します。

  • all parent object idsすべての親オブジェクトID

  • author name, email and date著者名、メールアドレス、および日付

  • committer name and email and the commit time.コミッター名とEメールアドレス、およびコミット時間。

While parent object ids are provided on the command line, author and committer information is taken from the following environment variables, if set:親オブジェクトIDはコマンドラインで提供されますが、作成者およびコミッターの情報は、設定されている場合は以下の環境変数から取得されます。

GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE

(nb "<", ">" and "\n"s are stripped)(nb "<"、 ">"、 "\ n"は削除されます)

In case (some of) these environment variables are not set, the information is taken from the configuration items user.name and user.email, or, if not present, the environment variable EMAIL, or, if that is not set, system user name and the hostname used for outgoing mail (taken from /etc/mailname and falling back to the fully qualified hostname when that file does not exist).これらの環境変数(の一部)が設定されていない場合、情報は設定項目user.nameおよびuser.emailから取得されます。存在しない場合は環境変数EMAIL、設定されていない場合はシステムユーザーから取得されます。送信メールに使用される名前とホスト名(/etc/mailnameファイルが存在しない場合は、完全修飾ホスト名から取得され、そのホスト名にフォールバックされます)。

A commit comment is read from stdin. If a changelog entry is not provided via "<" redirection, git commit-tree will just wait for one to be entered and terminated with ^D.コミットコメントがstdinから読み込まれます。変更履歴エントリが "<"リダイレクトで提供されていない場合、git commit-treeは単にエントリが入力され^ Dで終了するのを待ちます。

DATE FORMATS日付フォーマット

The GIT_AUTHOR_DATE, GIT_COMMITTER_DATE environment variables support the following date formats:GIT_AUTHOR_DATEGIT_COMMITTER_DATE環境変数は次の日付形式をサポートしています。

Git internal format Gitの内部フォーマット

It is <unix timestamp> <time zone offset>, where <unix timestamp> is the number of seconds since the UNIX epoch. <time zone offset> is a positive or negative offset from UTC. For example CET (which is 1 hour ahead of UTC) is +0100.これは、ある<unix timestamp> <time zone offset>場合には、<unix timestamp>UNIXエポックからの秒数です。<time zone offset>UTCからの正または負のオフセットです。例えばCET(これはUTCより1時間進んでいます)です+0100

RFC 2822

The standard email format as described by RFC 2822, for example Thu, 07 Apr 2005 22:13:13 +0200.たとえば、RFC 2822で説明されている標準の電子メール形式Thu, 07 Apr 2005 22:13:13 +0200

ISO 8601

Time and date specified by the ISO 8601 standard, for example 2005-04-07T22:13:13. The parser accepts a space instead of the T character as well.たとえば、ISO 8601規格で指定されている日時2005-04-07T22:13:13。パーサーはT文字の代わりにスペースも受け入れます。

Note In addition, the date part is accepted in the following formats: YYYY.MM.DD, MM/DD/YYYY and DD.MM.YYYY. さらに、日付部分は次の形式で受け入れられます。YYYY.MM.DDMM/DD/YYYYおよびDD.MM.YYYY

Discussion討論

Git is to some extent character encoding agnostic.Gitはある程度文字コードを認識しません。

  • The contents of the blob objects are uninterpreted sequences of bytes. There is no encoding translation at the core level.BLOBオブジェクトの内容は、未解釈の一連のバイトです。コアレベルでのエンコード変換はありません。

  • 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 (.git/config (see git-config[1]), gitignore[5], gitattributes[5] and gitmodules[5]).パス名はUTF-8正規化形式Cでエンコードされています。これはツリーオブジェクト、インデックスファイル、参照名、コマンドライン引数のパス名、環境変数、設定ファイルに適用されます(.git/configgit-config [1]を参照))。 、gitignore [5]gitattributes [5]そしてgitmodules [5])。

    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.コアレベルでのGitはパス名を単にNUL以外のバイトのシーケンスとして扱うので、パス名のエンコード変換はありません(MacとWindowsを除く)。したがって、ASCII以外のパス名を使用することは、従来の拡張ASCIIエンコードを使用するプラットフォームおよびファイルシステムでもほとんどの場合うまくいきます。ただし、そのようなシステムで作成されたリポジトリは、UTF-8ベースのシステム(Linux、Mac、Windowsなど)では正しく機能しません。その逆も同様です。さらに、多くのGitベースのツールはパス名を単にUTF-8と仮定しているため、他のエンコーディングを正しく表示できません。

  • 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 not UTF-16/32, EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5, EUC-x, CP9xx etc.).コミットログメッセージは通常UTF-8でエンコードされていますが、他の拡張ASCIIエンコードもサポートされています。これにはISO-8859-x、CP125x、その他多くのものが含まれますが UTF-16/32、EBCDICおよびCJKマルチバイトエンコーディング(GBK、Shift-JIS、Big5、EUC-x、CP9xxなど)は含まれません。

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.コミットログメッセージはUTF-8でエンコードすることをお勧めしますが、コアとGit PorcelainはどちらもプロジェクトでUTF-8を強制しないように設計されています。特定のプロジェクトのすべての参加者が従来のエンコーディングを使用するほうが便利だと判断した場合、Gitはそれを禁止しません。ただし、留意すべき点がいくつかあります。

  1. git commit and git commit-tree issues 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 i18n.commitencoding in .git/config file, like this:git commitおよびgit commit-treeは、コミットログメッセージが有効なUTF-8文字列のように見えない場合に警告を発行します。ただし、明示的にプロジェクトで従来のエンコーディングを使用しているとは限りません。これを言う方法はこの.git/configようにファイルにi18n.commitencodingを持つことです:

    [i18n]
    	commitEncoding = ISO-8859-1

    Commit objects created with the above setting record the value of i18n.commitEncoding in its encoding 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.上記の設定で作成されたコミットオブジェクトはi18n.commitEncoding、その値をencodingヘッダーに記録します。これは後で見る人を助けるためです。このヘッダがないということは、コミットログメッセージがUTF-8でエンコードされていることを意味します。

  2. git log, git show, git blame and friends look at the encoding 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 i18n.logOutputEncoding in .git/config file, like this:git loggit showgit blame、および友達encodingは、コミットオブジェクトのヘッダを調べ、特に指定がない限り、ログメッセージをUTF-8に書き換えます。このように、i18n.logOutputEncodingin .git/configfileで希望の出力エンコーディングを指定できます。

    [i18n]
    	logOutputEncoding = ISO-8859-1

    If you do not have this configuration variable, the value of i18n.commitEncoding is used instead.この構成変数がない場合は、i18n.commitEncoding代わりにの値が使用されます。

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.UTF-8への再コーディングは必ずしも可逆的な操作ではないため、コミットがコミットオブジェクトレベルでUTF-8を強制するために行われたときにコミットログメッセージを再コーディングしないことを意図的に選択したことに注意してください。

FILESファイル

/etc/mailname/ etc / mailname

SEE ALSO関連項目

git-write-tree[1]git-write-tree [1]

GIT

Part of the git[1] suite一部のgit [1]スイート

関連記事

スポンサーリンク

擬似クラスにスタイル指定がないと擬似クラスの子孫要素への指定が効かない

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る