log

NAME

git-log - Show commit logsgit-log - コミットログを表示する

SYNOPSIS概要

git log [<options>] [<revision range>] [[--] <path>…​]

DESCRIPTION説明

Shows the commit logs.コミットログを表示します。

The command takes options applicable to the git rev-list command to control what is shown and how, and options applicable to the git diff-* commands to control how the changes each commit introduces are shown.このコマンドgit rev-listは、表示される内容と方法git diff-*を制御するためにコマンドに適用可能なオプションと、各コミットが導入する変更を表示する方法を制御するためにコマンドに適用可能なオプションを取ります。

OPTIONSオプション

--follow - フォロー

Continue listing the history of a file beyond renames (works only for a single file).名前の変更を超えてファイルの履歴を一覧表示し続けます(単一のファイルに対してのみ機能します)。

--no-decorate - 飾らない
--decorate[=short|full|auto|no] --decorate [= short | full | auto | no]

Print out the ref names of any commits that are shown. If short is specified, the ref name prefixes refs/heads/, refs/tags/ and refs/remotes/ will not be printed. If full is specified, the full ref name (including prefix) will be printed. If auto is specified, then if the output is going to a terminal, the ref names are shown as if short were given, otherwise no ref names are shown. The default option is short.表示されているコミットの参照名を表示します。場合は短いが指定され、REF名前が接頭辞レフリー/ヘッド/レフリー/タグ/及びレフリー/リモコンを/印刷されません。fullが指定されている場合は、完全な参照名(プレフィックスを含む)が印刷されます。場合はautoが指定されている出力が端末に起こっている場合、参照名が示されているかのように、その後、短いが与えられた、そうでなければ参照名が表示されません。デフォルトのオプションはshortです。

--decorate-refs=<pattern> --decorate-refs = <パターン>
--decorate-refs-exclude=<pattern> --decorate-refs-exclude = <パターン>

If no --decorate-refs is given, pretend as if all refs were included. For each candidate, do not use it for decoration if it matches any patterns given to --decorate-refs-exclude or if it doesn’t match any of the patterns given to --decorate-refs.no --decorate-refsが与えられた場合、すべての参照が含まれているかのようにふりをします。候補ごとに、に与えられたパターンに一致する--decorate-refs-exclude場合、またはに与えられたパターンのいずれとも一致しない場合は、装飾に使用しないでください--decorate-refs

--source - ソース

Print out the ref name given on the command line by which each commit was reached.各コミットに到達したコマンドラインで与えられた参照名を表示します。

--use-mailmap

Use mailmap file to map author and committer names and email addresses to canonical real names and email addresses. See git-shortlog[1].mailmapファイルを使用して、作成者とコミッターの名前とEメールアドレスを正規の実名とEメールアドレスにマッピングします。git-shortlog [1]を参照してください。

--full-diff

Without this flag, git log -p <path>... shows commits that touch the specified paths, and diffs about the same specified paths. With this, the full diff is shown for commits that touch the specified paths; this means that "<path>…​" limits only commits, and doesn’t limit diff for those commits.このフラグがなければgit log -p <path>...、指定されたパスに触れるコミットを表示し、同じ指定されたパスについて差分をとります。これにより、指定されたパスに触れるコミットの完全差分が表示されます。これは、 "<path>…"がコミットのみを制限し、それらのコミットに対するdiffを制限しないことを意味します。

Note that this affects all diff-based output types, e.g. those produced by --stat, etc.これはすべてのdiffベースの出力タイプ、例えばによって生成されたもの--statなどに影響することに注意してください

--log-size

Include a line “log size <number>” in the output for each commit, where <number> is the length of that commit’s message in bytes. Intended to speed up tools that read log messages from git log output by allowing them to allocate space in advance.各コミットの出力に「log size <number>」という行を含めます。<number>はそのコミットのメッセージの長さ(バイト単位)です。git log事前にスペースを割り当てられるようにすることで、ログメッセージを出力から読み取るツールを高速化することを目的としています。

-L <start>,<end>:<file> -L <開始>、<終了>:<ファイル>
-L :<funcname>:<file> -L:<funcname>:<file>

Trace the evolution of the line range given by "<start>,<end>" (or the function name regex <funcname>) within the <file>. You may not give any pathspec limiters. This is currently limited to a walk starting from a single revision, i.e., you may only give zero or one positive revision arguments. You can specify this option more than once.<file>内の "<start>、<end>"(または関数名regex <funcname>)で指定された行範囲の展開をたどります。あなたはいかなるパススペックリミッターも与えてはいけません。これは現在、単一のリビジョンから始まるウォーキングに限定されています。つまり、ゼロまたは1つの正のリビジョン引数を与えることができます。このオプションは複数回指定できます。

<start> and <end> can take one of these forms:<start>と<end>は次のいずれかの形式を取ります。

  • number

    If <start> or <end> is a number, it specifies an absolute line number (lines count from 1).<start>または<end>が数値の場合は、絶対行番号を指定します(1からの行数)。

  • /regex//正規表現/

    This form will use the first line matching the given POSIX regex. If <start> is a regex, it will search from the end of the previous -L range, if any, otherwise from the start of file. If <start> is “^/regex/”, it will search from the start of file. If <end> is a regex, it will search starting at the line given by <start>.このフォームは与えられたPOSIX正規表現にマッチする最初の行を使います。<start>が正規表現の-L場合、前の範囲の末尾から(存在する場合)、それ以外の場合はファイルの先頭から検索します。<start>が“ ^ / regex /”の場合、ファイルの先頭から検索します。<end>が正規表現の場合、<start>で与えられた行から検索します。

  • +offset or -offset+ offsetまたは-offset

    This is only valid for <end> and will specify a number of lines before or after the line given by <start>.これは<end>に対してのみ有効であり、<start>によって与えられた行の前後の行数を指定します。

If “:<funcname>” is given in place of <start> and <end>, it is a regular expression that denotes the range from the first funcname line that matches <funcname>, up to the next funcname line. “:<funcname>” searches from the end of the previous -L range, if any, otherwise from the start of file. “^:<funcname>” searches from the start of file.<start>と<end>の代わりに“:<funcname>”が指定されている場合は、<funcname>と一致する最初のfuncname行から次のfuncname行までの範囲を表す正規表現です。“:<funcname>”は-L、もしあれば前の範囲の終わりから検索し、そうでなければファイルの先頭から検索します。“ ^:<funcname>”はファイルの先頭から検索します。

<revision range> <改訂範囲>

Show only commits in the specified revision range. When no <revision range> is specified, it defaults to HEAD (i.e. the whole history leading to the current commit). origin..HEAD specifies all the commits reachable from the current commit (i.e. HEAD), but not from origin. For a complete list of ways to spell <revision range>, see the Specifying Ranges section of gitrevisions[7].指定されたリビジョン範囲内のコミットのみを表示します。<revision range>が指定されていない場合は、デフォルトHEAD(つまり、現在のコミットに至る全履歴)になります。origin..HEAD現在のコミット(すなわちHEAD)から到達可能であるが到達可能ではないすべてのコミットを指定しますorigin。<revision range>をつづる方法の完全なリストはgitrevisions [7]の範囲指定の節を見てください。

[--] <path>…​ [ - ] <パス>…

Show only commits that are enough to explain how the files that match the specified paths came to be. See History Simplification below for details and other simplification modes.指定したパスに一致するファイルがどのようになったかを説明するのに十分なコミットのみを表示します。参照履歴の簡素化を詳細や他の簡素化モードの下に。

Paths may need to be prefixed with -- to separate them from options or the revision range, when confusion arises.--混乱が生じた場合、パスはオプションやリビジョン範囲と区別するために前に付ける必要があるかもしれません。

Commit Limitingコミット制限

Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied.説明で説明されている特別な表記法を使用してリストされるべきコミットの範囲を指定することに加えて、追加のコミット制限が適用されるかもしれません。

Using more options generally further limits the output (e.g. --since=<date1> limits to commits newer than <date1>, and using it with --grep=<pattern> further limits to commits whose log message has a line that matches <pattern>), unless otherwise noted.出力は、(例えば、一般的にさらに多くのオプションを制限する使用--since=<date1>制限がより新しいコミットするために<date1>、およびでそれを使用して--grep=<pattern>、そのログメッセージと一致する行を有するコミットするためにさらに制限<pattern>)特に断りのない限り、。

Note that these are applied before commit ordering and formatting options, such as --reverse.これらは、コミットの順序付けおよびフォーマットオプション(たとえば)の前に適用されることに注意してください--reverse

-<number> - <番号>
-n <number> -n <番号>
--max-count=<number> --max-count = <番号>

Limit the number of commits to output.出力するコミット数を制限します。

--skip=<number> --skip = <番号>

Skip number commits before starting to show the commit output.コミットの出力を表示し始める前にnumberのコミットをスキップします。

--since=<date> --since = <日付>
--after=<date> --after = <日付>

Show commits more recent than a specific date.特定の日付より最近のコミットを表示します。

--until=<date> --until = <日付>
--before=<date> --before = <日付>

Show commits older than a specific date.特定の日付よりも古いコミットを表示します。

--author=<pattern> --author = <パターン>
--committer=<pattern> --committer = <パターン>

Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression). With more than one --author=<pattern>, commits whose author matches any of the given patterns are chosen (similarly for multiple --committer=<pattern>).指定されたパターン(正規表現)に一致する作成者/コミッターヘッダー行を持つものにコミット出力を制限します。複数の場合--author=<pattern>は、与えられたパターンのいずれかに一致する作者のコミットが選択されます(複数の場合も同様--committer=<pattern>)。

--grep-reflog=<pattern> --grep-reflog = <パターン>

Limit the commits output to ones with reflog entries that match the specified pattern (regular expression). With more than one --grep-reflog, commits whose reflog message matches any of the given patterns are chosen. It is an error to use this option unless --walk-reflogs is in use.指定したパターン(正規表現)に一致するreflogエントリを持つコミット出力にコミット出力を制限します。複数の場合--grep-reflogは、reflogメッセージが任意のパターンに一致するコミットが選択されます。使用していない限り--walk-reflogs、このオプションを使用するとエラーになります。

--grep=<pattern> --grep = <パターン>

Limit the commits output to ones with log message that matches the specified pattern (regular expression). With more than one --grep=<pattern>, commits whose message matches any of the given patterns are chosen (but see --all-match).指定されたパターン(正規表現)に一致するログメッセージを持つコミット出力にコミット出力を制限します。複数ある場合--grep=<pattern>は、指定されたパターンのいずれかに一致するメッセージを持つコミットが選択されます(ただし参照--all-match)。

When --show-notes is in effect, the message from the notes is matched as if it were part of the log message.--show-notesが有効な場合、ノートからのメッセージはまるでそれがログメッセージの一部であるかのように照合されます。

--all-match

Limit the commits output to ones that match all given --grep, instead of ones that match at least one.コミット出力を--grep、少なくとも1つに一致するものではなく、指定されたすべてに一致するものに制限します。

--invert-grep

Limit the commits output to ones with log message that do not match the pattern specified with --grep=<pattern>.で指定されたパターンと一致しないログメッセージを持つものにコミット出力を制限します--grep=<pattern>

-i -私
--regexp-ignore-case

Match the regular expression limiting patterns without regard to letter case.大文字と小文字を区別せずに正規表現制限パターンを一致させます。

--basic-regexp

Consider the limiting patterns to be basic regular expressions; this is the default.制限パターンを基本的な正規表現と見なします。これがデフォルトです。

-E
--extended-regexp

Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions.制限パターンをデフォルトの基本正規表現ではなく拡張正規表現にすることを検討してください。

-F
--fixed-strings - 固定文字列

Consider the limiting patterns to be fixed strings (don’t interpret pattern as a regular expression).制限パターンを固定文字列とみなします(patternを正規表現として解釈しないでください)。

-P
--perl-regexp

Consider the limiting patterns to be Perl-compatible regular expressions.制限パターンがPerl互換の正規表現であると考えてください。

Support for these types of regular expressions is an optional compile-time dependency. If Git wasn’t compiled with support for them providing this option will cause it to die.これらの種類の正規表現のサポートは、オプションのコンパイル時の依存関係です。Gitがそれらをサポートするようにコンパイルされていない場合、このオプションを提供することでそれは死にます。

--remove-empty

Stop when a given path disappears from the tree.与えられたパスがツリーから消えたら停止します。

--merges - マージ

Print only merge commits. This is exactly the same as --min-parents=2.マージコミットのみを表示します。これはとまったく同じ--min-parents=2です。

--no-merges - いいえマージ

Do not print commits with more than one parent. This is exactly the same as --max-parents=1.複数の親とコミットを印刷しません。これはとまったく同じ--max-parents=1です。

--min-parents=<number> --min-保護者= <番号>
--max-parents=<number> --max-保護者= <番号>
--no-min-parents - no-min-両親
--no-max-parents --no-max-両親

Show only commits which have at least (or at most) that many parent commits. In particular, --max-parents=1 is the same as --no-merges, --min-parents=2 is the same as --merges. --max-parents=0 gives all root commits and --min-parents=3 all octopus merges.少なくとも(または多くても)その親のコミットがあるコミットのみを表示します。具体的には、--max-parents=1同じであり--no-merges--min-parents=2同じです--merges--max-parents=0すべてのルートコミットと--min-parents=3すべてのタコのマージを行います。

--no-min-parents and --no-max-parents reset these limits (to no limit) again. Equivalent forms are --min-parents=0 (any commit has 0 or more parents) and --max-parents=-1 (negative numbers denote no upper limit).--no-min-parentsそして--no-max-parentsこれらの制限を(制限なしに)再度設定します。同等の形式は--min-parents=0(任意のコミットが0個以上の親を持つ)および--max-parents=-1(負数は上限なしを意味します)です。

--first-parent - 最初の親

Follow only the first parent commit upon seeing a merge commit. This option can give a better overview when viewing the evolution of a particular topic branch, because merges into a topic branch tend to be only about adjusting to updated upstream from time to time, and this option allows you to ignore the individual commits brought in to your history by such a merge. Cannot be combined with --bisect.マージコミットを見て最初の親コミットのみをたどります。トピックブランチへのマージは時々更新されたアップストリームに調整することについてのみである傾向があるのでこのオプションは特定のトピックブランチの展開を見るときより良い概観を与えることができます、そしてこのオプションはあなたにもたらされた個々のコミットを無視することを可能にしますそのようなマージによるあなたの歴史。--bisectと組み合わせることはできません。

--not - じゃない

Reverses the meaning of the ^ prefix (or lack thereof) for all following revision specifiers, up to the next --not.後続のすべてのリビジョン指定子の^接頭辞の意味(またはその欠如)を、次の意味まで逆にします--not

--all - すべて

Pretend as if all the refs in refs/, along with HEAD, are listed on the command line as <commit>.refs/と一緒に、すべての参照が<commit>HEADとしてコマンドラインにリストされているかのようにふりをします。

--branches[=<pattern>] --branches [= <パターン>]

Pretend as if all the refs in refs/heads are listed on the command line as <commit>. If <pattern> is given, limit branches to ones matching given shell glob. If pattern lacks ?, *, or [, /* at the end is implied.すべての参照refs/headsがコマンドラインに<commit>としてリストされているかのようにふりをします。<pattern>が与えられた場合、与えられたシェルグロブにマッチするものに分岐を制限します。パターンが足りない末尾の、*、または[/ *が暗黙的に指定されています。

--tags[=<pattern>] --tags [= <パターン>]

Pretend as if all the refs in refs/tags are listed on the command line as <commit>. If <pattern> is given, limit tags to ones matching given shell glob. If pattern lacks ?, *, or [, /* at the end is implied.すべての参照refs/tagsがコマンドラインに<commit>としてリストされているかのようにふりをします。<pattern>が与えられた場合、タグを与えられたシェルグロブにマッチするものに制限します。パターンが足りない末尾の、*、または[/ *が暗黙的に指定されています。

--remotes[=<pattern>] --remotes [= <パターン>]

Pretend as if all the refs in refs/remotes are listed on the command line as <commit>. If <pattern> is given, limit remote-tracking branches to ones matching given shell glob. If pattern lacks ?, *, or [, /* at the end is implied.すべての参照refs/remotesがコマンドラインに<commit>としてリストされているかのようにふりをします。<pattern>が与えられた場合、リモートトラッキングブランチを与えられたシェルグロブにマッチするものに制限します。パターンが足りない末尾の、*、または[/ *が暗黙的に指定されています。

--glob=<glob-pattern> --glob = <グロブパターン>

Pretend as if all the refs matching shell glob <glob-pattern> are listed on the command line as <commit>. Leading refs/, is automatically prepended if missing. If pattern lacks ?, *, or [, /* at the end is implied.シェルglob <glob-pattern>に一致するすべての参照が<commit>としてコマンドラインにリストされているかのようにふりをします。先行参照/は、見つからない場合は自動的に先頭に追加されます。パターンが足りない末尾の、*、または[/ *が暗黙的に指定されています。

--exclude=<glob-pattern> --exclude = <グローバルパターン>

Do not include refs matching <glob-pattern> that the next --all, --branches, --tags, --remotes, or --glob would otherwise consider. Repetitions of this option accumulate exclusion patterns up to the next --all, --branches, --tags, --remotes, or --glob option (other options or arguments do not clear accumulated patterns).一致REFS含めないでください<グロブパターン>次のことを--all--branches--tags--remotes、または--globそれ以外の場合は検討します。次回まで、このオプションは累積除外パターンの繰り返し--all--branches--tags--remotes、または--globオプション(他のオプションや引数蓄積パターンをクリアしないでください)。

The patterns given should not begin with refs/heads, refs/tags, or refs/remotes when applied to --branches, --tags, or --remotes, respectively, and they must begin with refs/ when applied to --glob or --all. If a trailing /* is intended, it must be given explicitly.始めるべきではない与えられたパターンはrefs/headsrefs/tags、またはrefs/remotesに適用された場合--branches--tagsまたは--remotes、それぞれ、と彼らはで始まる必要がありますrefs/に適用されたとき--glob--all。末尾の/ *を意図している場合は、明示的に指定する必要があります。

--reflog

Pretend as if all objects mentioned by reflogs are listed on the command line as <commit>.reflogsによって言及されたすべてのオブジェクトがコマンドライン上にリストされているかのようにふりをします<commit>

--single-worktree - シングルワークツリー

By default, all working trees will be examined by the following options when there are more than one (see git-worktree[1]): --all, --reflog and --indexed-objects. This option forces them to examine the current working tree only.デフォルトでは、すべての作業の木が2つ以上が存在するとき(参照、以下のオプションによって検討されるのgit-worktreeを[1] ):--all--reflog--indexed-objects。このオプションは、現在の作業ツリーのみを調べるように強制します。

--ignore-missing

Upon seeing an invalid object name in the input, pretend as if the bad input was not given.入力に無効なオブジェクト名が表示されたら、悪い入力が与えられていないように見せかける。

--bisect - 二等分

Pretend as if the bad bisection ref refs/bisect/bad was listed and as if it was followed by --not and the good bisection refs refs/bisect/good-* on the command line. Cannot be combined with --first-parent.あたかも悪い二等分のref refs/bisect/badがリストされているかのように、--notそしてそれが続いているようなふりをして、良い二等分のref refs/bisect/good-*がコマンドラインで参照されます。--first-parentと組み合わせることはできません。

--stdin

In addition to the <commit> listed on the command line, read them from the standard input. If a -- separator is seen, stop reading commits and start reading paths to limit the result.コマンドラインにリストされている<commit>に加えて、標準入力からそれらを読みます。--区切り文字が表示された場合は、結果を制限するためにコミットの読み取りを停止してパスの読み取りを開始します。

--cherry-mark - キャリーマーク

Like --cherry-pick (see below) but mark equivalent commits with = rather than omitting them, and inequivalent ones with +.同様に--cherry-pick(下記参照)が、と同等のコミットをマーク=ではなく、それらを省略比べ、および非等価もの+

--cherry-pick - チェリーピック

Omit any commit that introduces the same change as another commit on the “other side” when the set of commits are limited with symmetric difference.一連のコミットが対称的な違いで制限されている場合は、「反対側」の別のコミットと同じ変更を導入するコミットを省略します。

For example, if you have two branches, A and B, a usual way to list all commits on only one side of them is with --left-right (see the example below in the description of the --left-right option). However, it shows the commits that were cherry-picked from the other branch (for example, “3rd on b” may be cherry-picked from branch A). With this option, such pairs of commits are excluded from the output.例えば、2つのブランチがあり、AそしてBその片側だけにすべてのコミットをリストする通常の方法--left-rightがあり--left-rightます(オプションの説明の下の例を参照してください)。ただし、他のブランチから選択されたコミットが表示されます(たとえば、「3rd on b」はブランチAから選択されたチェックです)。このオプションを使用すると、そのようなコミットのペアは出力から除外されます。

--left-only
--right-only - ライトのみ

List only commits on the respective side of a symmetric difference, i.e. only those which would be marked < resp. > by --left-right.対称的な違いのそれぞれの側、すなわちそれぞれマークされるものだけをリストし<ます。>によって--left-right

For example, --cherry-pick --right-only A...B omits those commits from B which are in A or are patch-equivalent to a commit in A. In other words, this lists the + commits from git cherry A B. More precisely, --cherry-pick --right-only --no-merges gives the exact list.たとえば、--cherry-pick --right-only A...BコミットされBているコミットAまたはパッチと同等のコミットを削除しAます。言い換えれば、これは+からのコミットをリストしますgit cherry A B。より正確に--cherry-pick --right-only --no-mergesは、正確なリストを与えます。

--cherry - チェリー

A synonym for --right-only --cherry-mark --no-merges; useful to limit the output to the commits on our side and mark those that have been applied to the other side of a forked history with git log --cherry upstream...mybranch, similar to git cherry upstream mybranch.の同義語--right-only --cherry-mark --no-mergesgit log --cherry upstream...mybranchと同様に、出力を私たちの側のコミットに限定し、分岐した履歴の反対側に適用されたものをマークするのに便利ですgit cherry upstream mybranch

-g
--walk-reflogs

Instead of walking the commit ancestry chain, walk reflog entries from the most recent one to older ones. When this option is used you cannot specify commits to exclude (that is, ^commit, commit1..commit2, and commit1...commit2 notations cannot be used).コミット祖先チェーンを歩く代わりに、最新のものから古いものへとreflogエントリを歩きます。このオプションを使用すると、除外するコミットを指定できません(つまり、^ commitcommit1..commit2、およびcommit1 ... commit2の表記は使用できません)。

With --pretty format other than oneline (for obvious reasons), this causes the output to have two extra lines of information taken from the reflog. The reflog designator in the output may be shown as ref@{Nth} (where Nth is the reverse-chronological index in the reflog) or as ref@{timestamp} (with the timestamp for that entry), depending on a few rules:では--pretty以外の形式oneline(明白な理由のために)、これは出力がREFLOGから取られた情報の2本の余分なラインを持つようになります。出力REFLOG指示子は以下のように示すことができるref@{Nth}(ここでNthREFLOGで逆時系列のインデックスである)またはref@{timestamp}(そのエントリのタイムスタンプを有する)、いくつかのルールに応じて:

  1. If the starting point is specified as ref@{Nth}, show the index format.開始点がに指定されているref@{Nth}場合は、索引フォーマットを表示します。

  2. If the starting point was specified as ref@{now}, show the timestamp format.開始点がとして指定されているref@{now}場合は、タイムスタンプの形式を表示します。

  3. If neither was used, but --date was given on the command line, show the timestamp in the format requested by --date.どちらも使用されずに--dateコマンドラインで指定された場合は、で要求された形式でタイムスタンプを表示し--dateます。

  4. Otherwise, show the index format.そうでなければ、インデックスフォーマットを表示します。

Under --pretty=oneline, the commit message is prefixed with this information on the same line. This option cannot be combined with --reverse. See also git-reflog[1].の下--pretty=onelineで、コミットメッセージは同じ行のこの情報で始まります。このオプションと組み合わせることはできません--reversegit-reflog [1]もご覧ください。

--merge - マージ

After a failed merge, show refs that touch files having a conflict and don’t exist on all heads to merge.マージが失敗した後、touchファイルが競合していて、マージするすべてのヘッドに存在しないことを示します。

--boundary - 境界

Output excluded boundary commits. Boundary commits are prefixed with -.除外された境界コミットを出力します。境界コミットにはプレフィックスが付き-ます。

History Simplification履歴の簡素化

Sometimes you are only interested in parts of the history, for example the commits modifying a particular <path>. But there are two parts of History Simplification, one part is selecting the commits and the other is how to do it, as there are various strategies to simplify the history.時々、あなたは歴史の一部、例えば特定の<path>を修正するコミットにだけ興味を持っています。しかし、履歴簡略化には2つの部分があります。1つはコミットを選択することで、もう1つは履歴を簡略化するためのさまざまな戦略があるため、その方法です。

The following options select the commits to be shown:以下のオプションは表示されるコミットを選択します。

<paths> <パス>

Commits modifying the given <paths> are selected.与えられた<paths>を変更するコミットが選択されています。

--simplify-by-decoration - 単純化による装飾

Commits that are referred by some branch or tag are selected.ブランチまたはタグによって参照されているコミットが選択されています。

Note that extra commits can be shown to give a meaningful history.意味のある歴史を与えるために追加のコミットを示すことができることに注意してください。

The following options affect the way the simplification is performed:以下のオプションは、単純化の実行方法に影響します。

Default mode デフォルトモード

Simplifies the history to the simplest history explaining the final state of the tree. Simplest because it prunes some side branches if the end result is the same (i.e. merging branches with the same content)履歴をツリーの最終状態を説明する最も単純な履歴に単純化します。最も単純なのは、最終結果が同じであればいくつかのサイドブランチを整理する(つまり、同じ内容のブランチをマージする)ためです。

--full-history

Same as the default mode, but does not prune some history.デフォルトモードと同じですが、履歴を削除しません。

--dense - 濃い

Only the selected commits are shown, plus some to have a meaningful history.選択されたコミットだけが表示され、さらにいくつかは意味のある履歴を持つために表示されます。

--sparse - スパース

All commits in the simplified history are shown.簡略化された履歴内のすべてのコミットが表示されます。

--simplify-merges

Additional option to --full-history to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge.--full-historyこのマージに貢献する選択されたコミットがないため、結果の履歴から不要なマージを削除するための追加オプション。

--ancestry-path

When given a range of commits to display (e.g. commit1..commit2 or commit2 ^commit1), only display commits that exist directly on the ancestry chain between the commit1 and commit2, i.e. commits that are both descendants of commit1, and ancestors of commit2.表示するコミットの範囲が与えられたとき(例えばcommit1..commit2又はcommit2 ^ commit1)との間の祖先鎖上に直接存在する、唯一の表示コミットcommit1commit2、すなわちの子孫共にコミットcommit1、との祖先commit2

A more detailed explanation follows.より詳細な説明は以下の通りです。

Suppose you specified foo as the <paths>. We shall call commits that modify foo !TREESAME, and the rest TREESAME. (In a diff filtered for foo, they look different and equal, respectively.)foo<paths>として指定したとします。foo!TREESAMEと残りのTREESAME を変更するコミットを呼び出します。(フィルタ処理されたdiff fooでは、それらはそれぞれ違って等しく見えます。)

In the following, we will always refer to the same example history to illustrate the differences between simplification settings. We assume that you are filtering for a file foo in this commit graph:以下では、単純化設定の違いを説明するために、常に同じ例の履歴を参照します。fooこのコミットグラフでファイルをフィルタリングしていると仮定します。

	  .-A---M---N---O---P---Q
	 /     /   /   /   /   /
	I     B   C   D   E   Y
	 \   /   /   /   /   /
	  `-------------'   X

The horizontal line of history A---Q is taken to be the first parent of each merge. The commits are:履歴の水平線A --- Qは、各マージの最初の親と見なされます。コミットは次のとおりです。

  • I is the initial commit, in which foo exists with contents “asdf”, and a file quux exists with contents “quux”. Initial commits are compared to an empty tree, so I is !TREESAME.I初期コミットで、foo内容 "asdf" quuxが存在し、ファイルが内容 "quux"で存在します。初期コミットは空のツリーと比較されるのでI、!TREESAMEもそうです。

  • In A, foo contains just “foo”.Afoo「foo」だけが含まれています。

  • B contains the same change as A. Its merge M is trivial and hence TREESAME to all parents.Bと同じ変更が含まれていAます。そのマージMは簡単なので、すべての親にとってTREESAMEです。

  • C does not change foo, but its merge N changes it to “foobar”, so it is not TREESAME to any parent.C変更されませんfooが、マージNによって“ foobar”に変更されるため、どの親にとってもTREESAMEにはなりません。

  • D sets foo to “baz”. Its merge O combines the strings from N and D to “foobarbaz”; i.e., it is not TREESAME to any parent.Dfoo「baz」に設定します。そのマージOは"foobarbaz" からのNそしてDへの文字列を結合します。つまり、どの親にとってもTREESAMEではありません。

  • E changes quux to “xyzzy”, and its merge P combines the strings to “quux xyzzy”. P is TREESAME to O, but not to E.Equux「xyzzy」に変更され、マージPによって文字列が「quux xyzzy」に結合されます。PTREESAMEはですがO、はしませんE

  • X is an independent root commit that added a new file side, and Y modified it. Y is TREESAME to X. Its merge Q added side to P, and Q is TREESAME to P, but not to Y.X新しいファイルを追加し、それsideY修正した独立したルートコミットです。YにTREESAME Xです。そのマージはQ追加さsidePQTREESAMEになりますが、にはなりPませんY

rev-list walks backwards through history, including or excluding commits based on whether --full-history and/or parent rewriting (via --parents or --children) are used. The following settings are available.rev-list--full-history--parentsまたは経由で--children)親のリライトが使用されているかどうかに基づいてコミットを含めたり除外したりして、履歴を逆方向に歩きます。以下の設定が可能です。

Default mode デフォルトモード

Commits are included if they are not TREESAME to any parent (though this can be changed, see --sparse below). If the commit was a merge, and it was TREESAME to one parent, follow only that parent. (Even if there are several TREESAME parents, follow only one of them.) Otherwise, follow all parents.コミットがどの親にとってもTREESAMEではない場合は、コミットも含まれます(これは変更可能ですが、下記を--sparse参照)。コミットがマージであり、それが一方の親へのTREESAMEであった場合は、その親のみに従ってください。(TREESAMEの親が複数いる場合でも、そのうちの1つだけを守ってください。)それ以外の場合は、すべての親を守ってください。

This results in:これは次のようになります。

	  .-A---N---O
	 /     /   /
	I---------D

Note how the rule to only follow the TREESAME parent, if one is available, removed B from consideration entirely. C was considered via N, but is TREESAME. Root commits are compared to an empty tree, so I is !TREESAME.TREESAMEの親のみに従うという規則がある場合は、それBを考慮から完全に削除することに注意してください。C経由Nで検討されましたが、TREESAMEです。ルートコミットは空のツリーと比較されるのでI、!TREESAMEもそうです。

Parent/child relations are only visible with --parents, but that does not affect the commits selected in default mode, so we have shown the parent lines.親子関係はでのみ表示--parentsされますが、これはデフォルトモードで選択されたコミットには影響しませんので、親ラインを表示しました。

--full-history without parent rewriting 親の書き換えなしの--full-history

This mode differs from the default in one point: always follow all parents of a merge, even if it is TREESAME to one of them. Even if more than one side of the merge has commits that are included, this does not imply that the merge itself is! In the example, we getこのモードは1つの点でデフォルトとは異なります。たとえそれがそれらのうちの1つに対するTREESAMEであっても、常にマージのすべての親に従うことです。マージの片側以上にコミットが含まれていても、マージ自体がコミットされているとは限りません。この例では、

	I  A  B  N  D  O  P  Q

M was excluded because it is TREESAME to both parents. E, C and B were all walked, but only B was !TREESAME, so the others do not appear.M両親にはTREESAMEなので除外しました。ECそしてBすべてが歩いたが、唯一のB!TREESAMEだったので、他の人は現れない。

Note that without parent rewriting, it is not really possible to talk about the parent/child relationships between the commits, so we show them disconnected.親の書き換えがなければ、コミット間の親子関係について話すことは実際には不可能であるため、それらを切断して示します。

--full-history with parent rewriting 親の書き換えを伴う--full-history

Ordinary commits are only included if they are !TREESAME (though this can be changed, see --sparse below).通常のコミットは!TREESAMEである場合にのみ含まれます(これは変更可能ですが、下記を--sparse参照)。

Merges are always included. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves. This results inマージは常に含まれています。ただし、その親リストは書き換えられています。各親に沿って、自分自身に含まれていないコミットを削除します。これは

	  .-A---M---N---O---P---Q
	 /     /   /   /   /
	I     B   /   D   /
	 \   /   /   /   /
	  `-------------'

Compare to --full-history without rewriting above. Note that E was pruned away because it is TREESAME, but the parent list of P was rewritten to contain E's parent I. The same happened for C and N, and X, Y and Q.--full-history上記と書き換えずに比較してください。EそれがTREESAMEであるので剪定されたことに注意してください、しかしPの親リストはEの親を含むように書き直されましたICand N、and XYand についても同じことが起こりましたQ

In addition to the above settings, you can change whether TREESAME affects inclusion:上記の設定に加えて、TREESAMEが包含に影響するかどうかを変更できます。

--dense - 濃い

Commits that are walked are included if they are not TREESAME to any parent.それらがどの親にとってもTREESAMEではない場合、ウォークされたコミットは含まれます。

--sparse - スパース

All commits that are walked are included.実行されたすべてのコミットが含まれています。

Note that without --full-history, this still simplifies merges: if one of the parents is TREESAME, we follow only that one, so the other sides of the merge are never walked.それがなければ--full-history、これはやはりマージを単純化することに注意してください。もし親のうちの1人がTREESAMEであるならば、私たちはその1つだけに従うので、マージの反対側は決して歩かれません。

--simplify-merges

First, build a history graph in the same way that --full-history with parent rewriting does (see above).最初に、--full-history親の書き換えと同じ方法で履歴グラフを作成します(上記を参照)。

Then simplify each commit C to its replacement C' in the final history according to the following rules:次に、以下の規則に従って、各履歴を最終履歴でC置き換えることを単純化しC'ます。

  • Set C' to C.に設定C'Cます。

  • Replace each parent P of C' with its simplification P'. In the process, drop parents that are ancestors of other parents or that are root commits TREESAME to an empty tree, and remove duplicates, but take care to never drop all parents that we are TREESAME to.の各親PC'単純化して置き換えますP'。その過程で、他の親の先祖であるか、またはrootである親を空のツリーにドロップし、重複を削除します。ただし、TREESAMEであるすべての親をドロップしないように注意してください。

  • If after this parent rewriting, C' is a root or merge commit (has zero or >1 parents), a boundary commit, or !TREESAME, it remains. Otherwise, it is replaced with its only parent.この親の書き換え後にC'、ルートコミットまたはマージコミット(0個以上の親を持つ)、境界コミット、または!TREESAMEであれば、そのまま残ります。それ以外の場合は、唯一の親に置き換えられます。

The effect of this is best shown by way of comparing to --full-history with parent rewriting. The example turns into:この効果は--full-history、親の書き換えとの比較によって最もよく示されます。例は次のようになります。

	  .-A---M---N---O
	 /     /       /
	I     B       D
	 \   /       /
	  `---------'

Note the major differences in N, P, and Q over --full-history:主要な相違点に注意してくださいNPQオーバー--full-history

  • N's parent list had I removed, because it is an ancestor of the other parent M. Still, N remained because it is !TREESAME.Nの親リストはIもう一方の親の祖先であるため削除されましたM。それでも、まだN残っています!TREESAME。

  • P's parent list similarly had I removed. P was then removed completely, because it had one parent and is TREESAME.Pの親リストも同様にI削除されました。Pそれは完全に削除されました、なぜならそれは1つの親を持ち、TREESAMEだからです。

  • Q's parent list had Y simplified to X. X was then removed, because it was a TREESAME root. Q was then removed completely, because it had one parent and is TREESAME.Qの親リストはにY整理されましたXXそれはTREESAMEルートだったので、その後削除されました。Qそれは完全に削除されました、なぜならそれは1つの親を持ち、TREESAMEだからです。

Finally, there is a fifth simplification mode available:最後に、利用可能な5番目の単純化モードがあります。

--ancestry-path

Limit the displayed commits to those directly on the ancestry chain between the “from” and “to” commits in the given commit range. I.e. only display commits that are ancestor of the “to” commit and descendants of the “from” commit.表示されたコミットを、指定されたコミット範囲内の「from」と「to」のコミットの間の祖先チェーン上のコミットに直接制限します。つまり、「to」コミットの先祖であり、「from」コミットの子孫であるコミットのみを表示します。

As an example use case, consider the following commit history:使用例として、次のコミット履歴を考えます。

	    D---E-------F
	   /     \       \
	  B---C---G---H---I---J
	 /                     \
	A-------K---------------L--M

A regular D..M computes the set of commits that are ancestors of M, but excludes the ones that are ancestors of D. This is useful to see what happened to the history leading to M since D, in the sense that “what does M have that did not exist in D”. The result in this example would be all the commits, except A and B (and D itself, of course).通常のD..MM、の先祖であるコミットのセットを計算しますが、の先祖であるコミットは除外しますD。「これには何が存在しなかったのか」という意味で、これはMそれ以来の歴史に何が起こったのかを見るのに役立ちます。この例の結果は、and (およびもちろんそれ自体)以外のすべてのコミットになります。DMDABD

When we want to find out what commits in M are contaminated with the bug introduced by D and need fixing, however, we might want to view only the subset of D..M that are actually descendants of D, i.e. excluding C and K. This is exactly what the --ancestry-path option does. Applied to the D..M range, it results in:私たちがコミット何を知りたいときMにより導入されたバグで汚染されD、定着必要、しかし、我々はのサブセットだけを表示したい場合がありますD..M実際の子孫であるD、すなわちを除く、CK。これはまさにその--ancestry-pathオプションが行うことです。D..Mの範囲に適用すると、次のようになります。

		E-------F
		 \       \
		  G---H---I---J
			       \
				L--M

The --simplify-by-decoration option allows you to view only the big picture of the topology of the history, by omitting commits that are not referenced by tags. Commits are marked as !TREESAME (in other words, kept after history simplification rules described above) if (1) they are referenced by tags, or (2) they change the contents of the paths given on the command line. All other commits are marked as TREESAME (subject to be simplified away).この--simplify-by-decorationオプションを使用すると、タグで参照されていないコミットを省略して、履歴のトポロジの全体像のみを表示できます。(1)タグで参照されている場合、または(2)コマンドラインで指定されたパスの内容が変更されている場合、コミットは!TREESAMEとしてマークされます(つまり、上記の履歴単純化規則に従って保持されます)。他のすべてのコミットはTREESAMEとしてマークされています(簡略化することがあります)。

Commit Orderingコミット注文

By default, the commits are shown in reverse chronological order.デフォルトでは、コミットは新しい順に表示されます。

--date-order - 日付順

Show no parents before all of its children are shown, but otherwise show commits in the commit timestamp order.すべての子が表示される前に親を表示しませんが、それ以外の場合はコミットのタイムスタンプ順にコミットを表示します。

--author-date-order

Show no parents before all of its children are shown, but otherwise show commits in the author timestamp order.すべての子が表示される前に親を表示しませんが、それ以外の場合は作成者のタイムスタンプ順にコミットを表示します。

--topo-order - 予約注文

Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed.すべての子が表示される前に親を表示しないでください。また、複数行の履歴でコミットが混在して表示されないようにしてください。

For example, in a commit history like this:たとえば、次のようなコミット履歴では、

    ---1----2----4----7
	\	       \
	 3----5----6----8---

where the numbers denote the order of commit timestamps, git rev-list and friends with --date-order show the commits in the timestamp order: 8 7 6 5 4 3 2 1.数字はコミットのタイムスタンプの順序を表し、git rev-list友達はタイムスタンプの順序でコミットを--date-order表示します。8 7 6 5 4 3 2 1。

With --topo-order, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5 3 1); some older commits are shown before newer ones in order to avoid showing the commits from two parallel development track mixed together.では--topo-order、8 6 5 3 7 4 2 1(または8 7 4 2 6 5 3 1)と表示されます。2つの並行した開発トラックからのコミットが混在して表示されないようにするために、いくつかの古いコミットを新しいコミットの前に表示します。

--reverse - 逆

Output the commits chosen to be shown (see Commit Limiting section above) in reverse order. Cannot be combined with --walk-reflogs.表示されるように選択されたコミットを出力します(上記のコミット制限のセクションを参照)。と組み合わせることはできません--walk-reflogs

Object Traversalオブジェクトトラバーサル

These options are mostly targeted for packing of Git repositories.これらのオプションは、主にGitリポジトリのパッキングを対象としています。

--no-walk[=(sorted|unsorted)] --no-walk [=(ソート済み|ソートなし)]

Only show the given commits, but do not traverse their ancestors. This has no effect if a range is specified. If the argument unsorted is given, the commits are shown in the order they were given on the command line. Otherwise (if sorted or no argument was given), the commits are shown in reverse chronological order by commit time. Cannot be combined with --graph.与えられたコミットのみを表示しますが、それらの先祖を横断しません。範囲が指定されている場合、これは効果がありません。引数unsortedが与えられると、コミットはコマンドラインで与えられた順番で表示されます。それ以外の場合(sorted引数が指定されていない場合、または引数が指定されていない場合)、コミット時刻の新しい順にコミットが表示されます。と組み合わせることはできません--graph

--do-walk - ウォーキング

Overrides a previous --no-walk.前を上書きし--no-walkます。

Commit Formattingコミットフォーマット

--pretty[=<format>] --pretty [= <フォーマット>]
--format=<format> --format = <フォーマット>

Pretty-print the contents of the commit logs in a given format, where <format> can be one of oneline, short, medium, full, fuller, email, raw, format:<string> and tformat:<string>. When <format> is none of the above, and has %placeholder in it, it acts as if --pretty=tformat:<format> were given.コミットログの内容を特定のフォーマットできれい表示します<フォーマット>は、オンラインショートミディアムフルフル電子メール未加工フォーマット:<文字列>およびt フォーマット:<文字列>のいずれかです。場合<フォーマット>上記のいずれでもない、と有し%プレースホルダをその中にいるかのように、それが作用する<形式>:--pretty = TFORMAT与えました。

See the "PRETTY FORMATS" section for some additional details for each format. When =<format> part is omitted, it defaults to medium.各形式の詳細については、「形式の設定」を参照してください。= <フォーマット>に一部が省略され、それはデフォルトの媒体

Note: you can specify the default pretty format in the repository configuration (see git-config[1]).注:リポジトリ設定でデフォルトのプリティフォーマットを指定できます(git-config [1]を参照)。

--abbrev-commit

Instead of showing the full 40-byte hexadecimal commit object name, show only a partial prefix. Non default number of digits can be specified with "--abbrev=<n>" (which also modifies diff output, if it is displayed).全40バイトの16進コミット・オブジェクト名を表示する代わりに、部分的な接頭部のみを表示してください。デフォルト以外の桁数は "--abbrev = <n>"で指定できます(表示されている場合はdiff出力も変更されます)。

This should make "--pretty=oneline" a whole lot more readable for people using 80-column terminals.これは "--pretty = oneline"を80桁の端末を使っている人にとってずっと読みやすくするはずです。

--no-abbrev-commit

Show the full 40-byte hexadecimal commit object name. This negates --abbrev-commit and those options which imply it such as "--oneline". It also overrides the log.abbrevCommit variable.全40バイトの16進コミット・オブジェクト名を表示します。これは否定され--abbrev-commit、それを意味する "--oneline"のようなオプションもあります。log.abbrevCommit変数も上書きされます。

--oneline

This is a shorthand for "--pretty=oneline --abbrev-commit" used together.これは、 "--pretty = oneline --abbrev-commit"を一緒に使用した場合の省略形です。

--encoding=<encoding> --encoding = <encoding>

The commit objects record the encoding used for the log message in their encoding header; this option can be used to tell the command to re-code the commit log message in the encoding preferred by the user. For non plumbing commands this defaults to UTF-8. Note that if an object claims to be encoded in X and we are outputting in X, we will output the object verbatim; this means that invalid sequences in the original commit may be copied to the output.コミットオブジェクトは、ログメッセージに使用されているエンコーディングをエンコーディングヘッダに記録します。このオプションを使用して、コミットログメッセージをユーザーが希望するエンコーディングで再コーディングするようにコマンドに指示できます。非配管コマンドの場合、これはデフォルトのUTF-8になります。オブジェクトがエンコードされているXと主張していて、出力しようとしている場合、Xそのオブジェクトをそのまま出力します。これは、元のコミットの無効なシーケンスが出力にコピーされる可能性があることを意味します。

--expand-tabs=<n> --expand-tabs = <n>
--expand-tabs
--no-expand-tabs

Perform a tab expansion (replace each tab with enough spaces to fill to the next display column that is multiple of <n>) in the log message before showing it in the output. --expand-tabs is a short-hand for --expand-tabs=8, and --no-expand-tabs is a short-hand for --expand-tabs=0, which disables tab expansion.出力に表示する前に、ログメッセージでタブ展開(各タブを<n>の倍数である次の表示列を埋めるのに十分なスペースで置き換えてください)を実行します。--expand-tabs以下のための短い手で--expand-tabs=8、と--no-expand-tabsのための短い手で--expand-tabs=0タブ拡張を無効にします。

By default, tabs are expanded in pretty formats that indent the log message by 4 spaces (i.e. medium, which is the default, full, and fuller).デフォルトでは、タブはログメッセージを4スペースインデントするきれいなフォーマットで展開されています(つまり、medium、これがデフォルト、full、およびfullerです)。

--notes[=<treeish>] --notes [= <ツリー>]

Show the notes (see git-notes[1]) that annotate the commit, when showing the commit log message. This is the default for git log, git show and git whatchanged commands when there is no --pretty, --format, or --oneline option given on the command line.コミットログメッセージを表示するときに、コミットに注釈を付けるメモ(git-notes [1]を参照)を表示します。これがデフォルトであるgit loggit showgit whatchangedノーがある場合コマンド--pretty--formatまたは--onelineコマンドラインで指定したオプションが。

By default, the notes shown are from the notes refs listed in the core.notesRef and notes.displayRef variables (or corresponding environment overrides). See git-config[1] for more details.デフォルトでは、表示されるメモは、core.notesRefand notes.displayRef変数(または対応する環境の上書き)に記載されているnotes refからのものです。詳しくはgit-config [1]を見てください。

With an optional <treeish> argument, use the treeish to find the notes to display. The treeish can specify the full refname when it begins with refs/notes/; when it begins with notes/, refs/ and otherwise refs/notes/ is prefixed to form a full name of the ref.オプションの<treeish>引数を指定すると、表示するノートを見つけるためにtreeishを使用します。treeishは始まるときに完全なrefnameを指定できますrefs/notes/。それはで始まる場合notes/refs/それ以外の場合はrefs/notes/REFの完全な名前を形成するために付けられます。

Multiple --notes options can be combined to control which notes are being displayed. Examples: "--notes=foo" will show only notes from "refs/notes/foo"; "--notes=foo --notes" will show both notes from "refs/notes/foo" and from the default notes ref(s).複数の--notesオプションを組み合わせて、どのノートを表示するかを制御できます。例: "--notes = foo"は "refs / notes / foo"からのノートのみを表示します。"--notes = foo --notes"は "refs / notes / foo"からのノートとデフォルトのノートrefからのノートの両方を表示します。

--no-notes

Do not show notes. This negates the above --notes option, by resetting the list of notes refs from which notes are shown. Options are parsed in the order given on the command line, so e.g. "--notes --notes=foo --no-notes --notes=bar" will only show notes from "refs/notes/bar".メモを表示しません。これは、--notesノートが表示されているノートrefのリストをリセットすることによって、上記のオプションを無効にします。オプションはコマンドラインで与えられた順番で解析されるので、例えば "--notes --notes = foo --no-notes --notes = bar"は "refs / notes / bar"からのノートのみを表示します。

--show-notes[=<treeish>] --show-notes [= <ツリー>]
--[no-]standard-notes - [no-] standard-notes

These options are deprecated. Use the above --notes/--no-notes options instead.これらのオプションは非推奨です。代わりに上記の--notes / - no-notesオプションを使用してください。

--show-signature

Check the validity of a signed commit object by passing the signature to gpg --verify and show the output.署名を渡して署名付きコミットオブジェクトの有効性を確認しgpg --verify、出力を表示します。

--relative-date - 相対日付

Synonym for --date=relative.の同義語--date=relative

--date=<format> --date = <フォーマット>

Only takes effect for dates shown in human-readable format, such as when using --pretty. log.date config variable sets a default value for the log command’s --date option. By default, dates are shown in the original time zone (either committer’s or author’s). If -local is appended to the format (e.g., iso-local), the user’s local time zone is used instead.使用時など、人間が読める形式で表示された日付に対してのみ有効です--prettylog.dateconfig変数は、logコマンドの--dateオプションのデフォルト値を設定します。デフォルトでは、日付は元のタイムゾーン(コミッタまたは作成者)で表示されます。-localが形式(たとえばiso-local)に追加されている場合は、代わりにユーザーのローカルタイムゾーンが使用されます。

--date=relative shows dates relative to the current time, e.g. “2 hours ago”. The -local option has no effect for --date=relative.--date=relative現在の時刻を基準にした日付を表示します(例:2時間前)。この-localオプションはには効果がありません--date=relative

--date=local is an alias for --date=default-local.--date=localのエイリアスです--date=default-local

--date=iso (or --date=iso8601) shows timestamps in a ISO 8601-like format. The differences to the strict ISO 8601 format are:--date=iso(または--date=iso8601)は、ISO 8601のような形式でタイムスタンプを表示します。厳密なISO 8601フォーマットとの違いは次のとおりです。

  • a space instead of the T date/time delimiterT日付/時刻区切り文字の代わりにスペース

  • a space between time and time zone時間とタイムゾーンの間のスペース

  • no colon between hours and minutes of the time zoneタイムゾーンの時間と分の間にコロンがない

--date=iso-strict (or --date=iso8601-strict) shows timestamps in strict ISO 8601 format.--date=iso-strict(または--date=iso8601-strict)は厳密なISO 8601形式でタイムスタンプを表示します。

+ --date=rfc (or --date=rfc2822) shows timestamps in RFC 2822 format, often found in email messages.+ --date=rfc(または--date=rfc2822)は、RFC 2822形式のタイムスタンプを示し、電子メールメッセージによく見られます。

+ --date=short shows only the date, but not the time, in YYYY-MM-DD format.+ --date=shortは日付のみを表示し、時刻は表示しませんYYYY-MM-DD

+ --date=raw shows the date as seconds since the epoch (1970-01-01 00:00:00 UTC), followed by a space, and then the timezone as an offset from UTC (a + or - with four digits; the first two are hours, and the second two are minutes). I.e., as if the timestamp were formatted with strftime("%s %z")). Note that the -local option does not affect the seconds-since-epoch value (which is always measured in UTC), but does switch the accompanying timezone value.+は、--date=rawUTCからのオフセットとして空間続くエポック秒として日付(1970-01-01 00:00:00)、その後タイムゾーンを(示し+、または-4桁と、最初の二つは時間であり、そして次の2つは分です)。つまり、タイムスタンプが)でフォーマットされているかのようにstrftime("%s %z")。この-localオプションはエポックからの秒数(常にUTCで測定される)には影響しませんが、付随するタイムゾーンの値を切り替えます。

+ --date=human shows the timezone if the timezone does not match the current time-zone, and doesn’t print the whole date if that matches (ie skip printing year for dates that are "this year", but also skip the whole date itself if it’s in the last few days and we can just say what weekday it was). For older dates the hour and minute is also omitted.+ --date=humanは、タイムゾーンが現在のタイムゾーンと一致しない場合はタイムゾーンを表示し、一致する場合は日付全体を表示しません(つまり、 "今年"の日付の場合は年の表示をスキップします。ここ数日で、私たちはちょうどそれが何曜日だったかを言うことができます)。それより古い日付では、時分も省略されます。

+ --date=unix shows the date as a Unix epoch timestamp (seconds since 1970). As with --raw, this is always in UTC and therefore -local has no effect.+ --date=unixは、UNIXエポックタイムスタンプとして日付を表示します(1970年からの秒数)。と同様に--raw、これは常にUTCであり、したがって-local効果はありません。

+ --date=format:... feeds the format ... to your system strftime, except for %z and %Z, which are handled internally. Use --date=format:%c to show the date in your system locale’s preferred format. See the strftime manual for a complete list of format placeholders. When using -local, the correct syntax is --date=format-local:....+ は内部的に処理される%zと%Zを除いて--date=format:...、フォーマット...をシステムに送りますstrftime--date=format:%cシステムロケールの優先形式で日付を表示するために使用します。strftimeフォーマットプレースホルダの完全なリストについてはマニュアルを参照してください。使用する-local場合、正しい構文は--date=format-local:...です。

+ --date=default is the default format, and is similar to --date=rfc2822, with a few exceptions:+ --date=defaultがデフォルトのフォーマットであり--date=rfc2822、いくつかの例外がありますが、に似ています。

  • there is no comma after the day-of-week曜日の後にコンマはありません

  • the time zone is omitted when the local time zone is usedローカルタイムゾーンが使用されている場合、タイムゾーンは省略されます。

--parents - 親

Print also the parents of the commit (in the form "commit parent…​"). Also enables parent rewriting, see History Simplification above.コミットの親も印刷します( "commit parent…"の形式で)。親の書き換えも可能にします。上の履歴の簡略化を参照してください。

--children - 子供

Print also the children of the commit (in the form "commit child…​"). Also enables parent rewriting, see History Simplification above.コミットの子も印刷します( "commit child…"の形式で)。また、親の書き換えを有効にします。上記の履歴の簡略化を参照してください。

--left-right - 左右

Mark which side of a symmetric difference a commit is reachable from. Commits from the left side are prefixed with < and those from the right with >. If combined with --boundary, those commits are prefixed with -.対称的な違いのどちら側からコミットに到達できるかをマークします。左側からのコミットは先頭に<、右側からのコミットは先頭に付き>ます。と組み合わせると--boundary、それらのコミットには接頭辞が付き-ます。

For example, if you have this topology:たとえば、次のトポロジがあるとします。

	     y---b---b  branch B
	    / \ /
	   /   .
	  /   / \
	 o---x---a---a  branch A

you would get an output like this:あなたはこのような出力を得るでしょう:

	$ git rev-list --left-right --boundary --pretty=oneline A...B
	>bbbbbbb... 3rd on b
	>bbbbbbb... 2nd on b
	<aaaaaaa... 3rd on a
	<aaaaaaa... 2nd on a
	-yyyyyyy... 1st on b
	-xxxxxxx... 1st on a
--graph - グラフ

Draw a text-based graphical representation of the commit history on the left hand side of the output. This may cause extra lines to be printed in between commits, in order for the graph history to be drawn properly. Cannot be combined with --no-walk.コミット履歴のテキストベースのグラフィック表示を出力の左側に描画します。これにより、グラフ履歴を正しく描画するために、コミットの間に余分な行が表示されることがあります。と組み合わせることはできません--no-walk

This enables parent rewriting, see History Simplification above.これは親の書き換えを可能にします。上の履歴の簡略化を見てください。

This implies the --topo-order option by default, but the --date-order option may also be specified.これは--topo-orderデフォルトでオプションを意味しますが、--date-orderオプションを指定することもできます。

--show-linear-break[=<barrier>] --show-linear-break [= <barrier>]

When --graph is not used, all history branches are flattened which can make it hard to see that the two consecutive commits do not belong to a linear branch. This option puts a barrier in between them in that case. If <barrier> is specified, it is the string that will be shown instead of the default one.--graphが使用されていない場合、すべての履歴ブランチはフラット化され、2つの連続したコミットが線形ブランチに属していないことがわかりにくくなります。この場合、このオプションはそれらの間に障壁を置きます。<barrier>を指定した場合は、デフォルトの文字列ではなく表示される文字列です。

Diff Formatting差分フォーマット

Listed below are options that control the formatting of diff output. Some of them are specific to git-rev-list[1], however other diff options may be given. See git-diff-files[1] for more options.下記はdiff出力のフォーマットを制御するオプションです。それらのいくつかはgit-rev-list [1]に特定のものですが、他のdiffオプションが与えられるかもしれません。その他のオプションについてはgit-diff-files [1]を見てください。

-c

With this option, diff output for a merge commit shows the differences from each of the parents to the merge result simultaneously instead of showing pairwise diff between a parent and the result one at a time. Furthermore, it lists only files which were modified from all parents.このオプションを指定すると、マージコミットの差分出力は、親と結果のペアごとの差分を一度に1つずつ表示するのではなく、各親からマージ結果までの差分を同時に表示します。さらに、それはすべての親から修正されたファイルだけをリストします。

--cc

This flag implies the -c option and further compresses the patch output by omitting uninteresting hunks whose contents in the parents have only two variants and the merge result picks one of them without modification.このフラグは-cオプションを暗示し、親の内容が2つのバリアントしか持たない興味のないハンクを省略することによってパッチ出力をさらに圧縮し、マージ結果は変更なしにそれらのうちの1つを選択します。

-m

This flag makes the merge commits show the full diff like regular commits; for each merge parent, a separate log entry and diff is generated. An exception is that only diff against the first parent is shown when --first-parent option is given; in that case, the output represents the changes the merge brought into the then-current branch.このフラグは通常のコミットのようにマージコミットに完全な差分を表示させます。各マージ親に対して、別々のログエントリとdiffが生成されます。例外は、--first-parentoptionが与えられたときに最初の親に対するdiffだけが表示されることです。その場合には、出力がマージがもたらした変化を表し、その後、現在のブランチを。

-r

Show recursive diffs.再帰的差分を表示します。

-t

Show the tree objects in the diff output. This implies -r.差分出力にツリーオブジェクトを表示します。これは意味し-rます。

PRETTY FORMATSプリティフォーマット

If the commit is a merge, and if the pretty-format is not oneline, email or raw, an additional line is inserted before the Author: line. This line begins with "Merge: " and the sha1s of ancestral commits are printed, separated by spaces. Note that the listed commits may not necessarily be the list of the direct parent commits if you have limited your view of history: for example, if you are only interested in changes related to a certain directory or file.コミットがマージで、プリティフォーマットがオンラインでも電子メールででもない場合Author:行の前に追加の行が挿入されます。この行は "Merge:"で始まり、先祖のコミットのsha1がスペースで区切られて表示されます。履歴の表示を制限している場合、リストされているコミットが必ずしも直接の親コミットのリストであるとは限らないことに注意してください。

There are several built-in formats, and you can define additional formats by setting a pretty.<name> config option to either another format name, or a format: string, as described below (see git-config[1]). Here are the details of the built-in formats:いくつかの組み込みフォーマットがあり、下記で説明されているように、pretty。<name> configオプションを他のフォーマット名かformat:文字列に設定することで追加フォーマットを定義することができます(git-config [1]参照)。組み込みフォーマットの詳細は以下のとおりです。

  • oneline一人ぼっち

    <sha1> <title line>

    This is designed to be as compact as possible.これはできるだけコンパクトになるように設計されています。

  • shortショート

    commit <sha1>
    Author: <author>
    <title line>
  • medium

    commit <sha1>
    Author: <author>
    Date:   <author date>
    <title line>
    <full commit message>
  • fullいっぱい

    commit <sha1>
    Author: <author>
    Commit: <committer>
    <title line>
    <full commit message>
  • fullerより充実した

    commit <sha1>
    Author:     <author>
    AuthorDate: <author date>
    Commit:     <committer>
    CommitDate: <committer date>
    <title line>
    <full commit message>
  • emailEメール

    From <sha1> <date>
    From: <author>
    Date: <author date>
    Subject: [PATCH] <title line>
    <full commit message>
  • raw

    The raw format shows the entire commit exactly as stored in the commit object. Notably, the SHA-1s are displayed in full, regardless of whether --abbrev or --no-abbrev are used, and parents information show the true parent commits, without taking grafts or history simplification into account. Note that this format affects the way commits are displayed, but not the way the diff is shown e.g. with git log --raw. To get full object names in a raw diff format, use --no-abbrev.生の形式全体がコミットオブジェクトに格納されているとおりにコミット示します。特に、SHA-1は--abbrevまたは--no-abbrevが使用されているかどうかにかかわらず完全に表示されます。また、保護者の情報は、移植や履歴の簡略化を考慮せずに、実際の親のコミットを示します。このフォーマットはコミットの表示方法には影響しますが、diffの表示方法には影響しませんgit log --raw。生の差分形式で完全なオブジェクト名を取得するには、を使用します--no-abbrev

  • format:<string>フォーマット:<文字列>

    The format:<string> format allows you to specify which information you want to show. It works a little bit like printf format, with the notable exception that you get a newline with %n instead of \n.フォーマットは:<文字列>の形式を使用すると、表示したいどの情報を指定することができます。printfフォーマットに少し似ていますが、\ nの代わりに%nを使用して改行を取得するという注目すべき例外があります。

    E.g, format:"The author of %h was %an, %ar%nThe title was >>%s<<%n" would show something like this:例えば、フォーマット: "%hの作者は%an、%ar%nでした。タイトルは>>%s <<%nでした"と表示されます。

    The author of fe6e0ee was Junio C Hamano, 23 hours ago
    The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<

    The placeholders are:プレースホルダーは以下のとおりです。

    • %H: commit hash%H:ハッシュをコミット

    • %h: abbreviated commit hash%h:短縮コミットハッシュ

    • %T: tree hash%T:ツリーハッシュ

    • %t: abbreviated tree hash%t:省略形のツリーハッシュ

    • %P: parent hashes%P:親ハッシュ

    • %p: abbreviated parent hashes%p:省略形の親ハッシュ

    • %an: author name%an:著者名

    • %aN: author name (respecting .mailmap, see git-shortlog[1] or git-blame[1])%aN:作者名(.mailmapを尊重します。git -shortlog [1]またはgit-blame [1]を参照)

    • %ae: author email%ae:作者のメールアドレス

    • %aE: author email (respecting .mailmap, see git-shortlog[1] or git-blame[1])%aE:作者の電子メール(.mailmapを尊重します。git -shortlog [1]またはgit-blame [1]を参照)

    • %ad: author date (format respects --date= option)%ad:作成者の日付(形式は--date = optionを考慮しています)

    • %aD: author date, RFC2822 style%aD:作成者日付、RFC 2822スタイル

    • %ar: author date, relative%ar:作成者日付、相対パス

    • %at: author date, UNIX timestamp%at:作成者日付、UNIXタイムスタンプ

    • %ai: author date, ISO 8601-like format%ai:作成者日付、ISO 8601風フォーマット

    • %aI: author date, strict ISO 8601 format%aI:作成者日付、厳密なISO 8601フォーマット

    • %cn: committer name%cn:コミッタ名

    • %cN: committer name (respecting .mailmap, see git-shortlog[1] or git-blame[1])%cN:コミッタ名(.mailmapを尊重します。git -shortlog [1]またはgit-blame [1]を参照)

    • %ce: committer email%ceコミッタメール

    • %cE: committer email (respecting .mailmap, see git-shortlog[1] or git-blame[1])%cE:committer email(.mailmapを尊重します。git -shortlog [1]またはgit-blame [1]を参照)

    • %cd: committer date (format respects --date= option)%cd:committer date(フォーマットは--date = optionを考慮しています)

    • %cD: committer date, RFC2822 style%cD:コミッタ日付、RFC 2822スタイル

    • %cr: committer date, relative%crコミッタ日付、相対パス

    • %ct: committer date, UNIX timestamp%ctコミッタ日付、UNIXタイムスタンプ

    • %ci: committer date, ISO 8601-like format%ci:コミッタ日付、ISO 8601風の形式

    • %cI: committer date, strict ISO 8601 format%cIコミッタ日付、厳密なISO 8601フォーマット

    • %d: ref names, like the --decorate option of git-log[1]%dgit-logの --decorateオプションのような参照名[1]

    • %D: ref names without the " (", ")" wrapping.%D: "("、 ")"の折り返しのない参照名

    • %S: ref name given on the command line by which the commit was reached (like git log --source), only works with git log%S:コミットに到達したコマンドラインで与えられた参照名(のようにgit log --source)。git log

    • %e: encoding%e:エンコード

    • %s: subject%s:件名

    • %f: sanitized subject line, suitable for a filename%f:ファイル名に適したサニタイズされた件名

    • %b: body%b:ボディ

    • %B: raw body (unwrapped subject and body)%B:未加工ボディ(ラップされていないサブジェクトとボディ)

    • %N: commit notes%N:メモをコミット

    • %GG: raw verification message from GPG for a signed commit%GG:署名されたコミットに対するGPGからの生の検証メッセージ

    • %G?: show "G" for a good (valid) signature, "B" for a bad signature, "U" for a good signature with unknown validity, "X" for a good signature that has expired, "Y" for a good signature made by an expired key, "R" for a good signature made by a revoked key, "E" if the signature cannot be checked (e.g. missing key) and "N" for no signature%G?:良い(有効な)署名には "G"、悪い署名には "B"、有効性が不明な有効な署名には "U"、期限が切れた有効な署名には "X"、有効な署名には "Y"を表示します。有効期限が切れた鍵によって作成されます。失効した鍵によって作成された良好な署名の場合は "R"、署名が確認できない場合は "E"(署名がないなど)

    • %GS: show the name of the signer for a signed commit%GS:署名されたコミットのための署名者の名前を表示します

    • %GK: show the key used to sign a signed commit%GK:署名されたコミットに署名するために使用されたキーを表示します

    • %GF: show the fingerprint of the key used to sign a signed commit%GF:署名されたコミットに署名するために使用されたキーのフィンガープリントを表示します

    • %GP: show the fingerprint of the primary key whose subkey was used to sign a signed commit%GP:署名付きコミットの署名にサブキーが使用された主キーのフィンガープリントを表示します

    • %gD: reflog selector, e.g., refs/stash@{1} or refs/stash@{2 minutes ago}; the format follows the rules described for the -g option. The portion before the @ is the refname as given on the command line (so git log -g refs/heads/master would yield refs/heads/master@{0}).%gD:reflogセレクタ、例えば、refs/stash@{1}またはrefs/stash@{2 minutes ago}; 形式は、-gオプションで説明されている規則に従います。の前の部分@は、コマンドラインで指定されているrefnameです(つまりgit log -g refs/heads/masteryield refs/heads/master@{0})。

    • %gd: shortened reflog selector; same as %gD, but the refname portion is shortened for human readability (so refs/heads/master becomes just master).%gd:reflogセレクタを短くしました。同様の%gD、しかしもしrefname部分は(そう人間の可読性のために短縮されるrefs/heads/masterだけとなりますmaster)。

    • %gn: reflog identity name%gn:ログID ID名

    • %gN: reflog identity name (respecting .mailmap, see git-shortlog[1] or git-blame[1])%gN:ログID名(.mailmapを尊重します。git -shortlog [1]またはgit-blame [1]を参照)

    • %ge: reflog identity email%ge:IDメールを再登録する

    • %gE: reflog identity email (respecting .mailmap, see git-shortlog[1] or git-blame[1])%gE:アイデンティティー電子メールを再ログ(.mailmapを尊重します。git -shortlog [1]またはgit-blame [1]を参照)

    • %gs: reflog subject%gs:件名を再ログ

    • %Cred: switch color to red%Cred:色を赤に変える

    • %Cgreen: switch color to green%Cgreen:色を緑色に切り替えます

    • %Cblue: switch color to blue%Cblue:色を青に変える

    • %Creset: reset colorクレスト%:色をリセット

    • %C(…​): color specification, as described under Values in the "CONFIGURATION FILE" section of git-config[1]. By default, colors are shown only when enabled for log output (by color.diff, color.ui, or --color, and respecting the auto settings of the former if we are going to a terminal). %C(auto,...) is accepted as a historical synonym for the default (e.g., %C(auto,red)). Specifying %C(always,...) will show the colors even when color is not otherwise enabled (though consider just using --color=always to enable color for the whole output, including this format and anything else git might color). auto alone (i.e. %C(auto)) will turn on auto coloring on the next placeholders until the color is switched again.%C(…)git-config [1]の "CONFIGURATION FILE"セクションの値で説明されている色指定。デフォルトでは、色は(でログ出力のために有効にする場合にのみ表示されcolor.diffcolor.uiまたは--color、そして尊重auto私たちは、端末しようとしている場合、元の設定)。%C(auto,...)デフォルトの歴史的同義語として受け入れられます(例:)%C(auto,red)%C(always,...)colorが他の方法で有効にされていない場合でも、指定すると色が表示されます(ただし--color=always、この形式やgitで色付けされる可能性があるものすべてを含め、出力全体に対してcolorを有効にすることを検討してください)。auto単独で(つまり%C(auto))色が再び切り替わるまで、次のプレースホルダーの自動色分けをオンにします。

    • %m: left (<), right (>) or boundary (-) mark%m:left(<)、right(>)、またはboundary(-)マーク

    • %n: newline%n:改行

    • %%: a raw %%%:生の

    • %x00: print a byte from a hex code%x00:16進コードから1バイトを印刷

    • %w([<w>[,<i1>[,<i2>]]]): switch line wrapping, like the -w option of git-shortlog[1].%w([<w> [、<i1> [、<i2>]]))git-shortlog [1]の -wオプションのように、行の折り返しを切り替えます。

    • %<(<N>[,trunc|ltrunc|mtrunc]): make the next placeholder take at least N columns, padding spaces on the right if necessary. Optionally truncate at the beginning (ltrunc), the middle (mtrunc) or the end (trunc) if the output is longer than N columns. Note that truncating only works correctly with N >= 2.%<(<N> [、trunc | ltrunc | mtrunc]):次のプレースホルダーに少なくともN列を取り、必要ならば右側にスペースを入れます。出力がN列よりも長い場合は、オプションで、先頭(ltrunc)、中央(mtrunc)、または末尾(trunc)を切り捨てます。切り捨ては、N> = 2でのみ正しく機能することに注意してください。

    • %<|(<N>): make the next placeholder take at least until Nth columns, padding spaces on the right if necessary%<|(<N>):次のプレースホルダーが少なくともN列目まで必要に応じて右にスペースを埋め込むようにします。

    • %>(<N>), %>|(<N>): similar to %<(<N>), %<|(<N>) respectively, but padding spaces on the left%>(<N>)%> |(<N>):それぞれ%<(<N>)%<|(<N>)に似ていますが、左側にスペースが埋め込まれています

    • %>>(<N>), %>>|(<N>): similar to %>(<N>), %>|(<N>) respectively, except that if the next placeholder takes more spaces than given and there are spaces on its left, use those spaces%>>(<N>)%>> |(<N>):それぞれ%>(<N>)%> |(<N>)に似ていますが、次のプレースホルダーが与えられたスペースよりも多くのスペースを必要とする場合は異なります。左側にスペースがあるので、それらのスペースを使う

    • %><(<N>), %><|(<N>): similar to %<(<N>), %<|(<N>) respectively, but padding both sides (i.e. the text is centered)%> <(<N>)%> <|(<N>):それぞれ%<(<N>)%<|(<N>)に似ていますが、両側にパディング(テキストの中央揃え)

    • %(trailers[:options]): display the trailers of the body as interpreted by git-interpret-trailers[1]. The trailers string may be followed by a colon and zero or more comma-separated options. If the only option is given, omit non-trailer lines from the trailer block. If the unfold option is given, behave as if interpret-trailer’s --unfold option was given. E.g., %(trailers:only,unfold) to do both.%(trailers [:options]):git-interpret-trailers [1]によって解釈された本体の予告編を表示します。trailersストリングは、結腸及びゼロ以上のカンマで区切られたオプションが続いてもよいです。onlyオプションが指定されている場合は、トレーラブロックから非トレーラ行を省略します。unfoldオプションが与えられた場合は、インタプリタトレーラの--unfoldオプションが与えられた場合と同じように振舞います。例えば、%(trailers:only,unfold)両方をすること。

Note Some placeholders may depend on other options given to the revision traversal engine. For example, the %g* reflog options will insert an empty string unless we are traversing reflog entries (e.g., by git log -g). The %d and %D placeholders will use the "short" decoration format if --decorate was not already provided on the command line. 一部のプレースホルダは、改訂トラバーサルエンジンに与えられた他のオプションに依存するかもしれません。例えば、%g*reflogオプションは、我々がreflogエントリをトラバースしているのでない限り(例えばbyでgit log -g)空の文字列を挿入します。あれば、プレースホルダ「ショート」の装飾形式を使用しますすでにコマンドラインで提供されていませんでした。 %d%D--decorate

If you add a + (plus sign) after % of a placeholder, a line-feed is inserted immediately before the expansion if and only if the placeholder expands to a non-empty string.プレースホルダの+後に(プラス記号)を追加すると、プレースホルダが空でない文字列に展開される場合に限り、展開の直前に改行が挿入されます。

If you add a - (minus sign) after % of a placeholder, all consecutive line-feeds immediately preceding the expansion are deleted if and only if the placeholder expands to an empty string.プレースホルダの-後に(マイナス記号)を追加すると、プレースホルダが空の文字列に展開された場合に限り、展開の直前の連続するすべての改行が削除されます。

If you add a ` ` (space) after % of a placeholder, a space is inserted immediately before the expansion if and only if the placeholder expands to a non-empty string.プレースホルダのの後に ``(スペース)を追加すると、プレースホルダが空でない文字列に展開される場合に限り、スペースが展開の直前に挿入されます。

  • tformat:tformat:

    The tformat: format works exactly like format:, except that it provides "terminator" semantics instead of "separator" semantics. In other words, each commit has the message terminator character (usually a newline) appended, rather than a separator placed between entries. This means that the final entry of a single-line format will be properly terminated with a new line, just as the "oneline" format does. For example:TFORMAT:フォーマットは、正確に同じように動作し形式:、それは代わりに「区切り」の意味の「ターミネーター」のセマンティクスを提供することを除いて。言い換えれば、各コミットはエントリ間に置かれる区切り文字ではなく、メッセージ終了文字(通常は改行)が追加されます。これは、 "oneline"フォーマットと同じように、単一行フォーマットの最後のエントリが新しい行で正しく終了することを意味します。例えば:

    $ git log -2 --pretty=format:%h 4da45bef \
      | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
    4da45be
    7134973 -- NO NEWLINE
    $ git log -2 --pretty=tformat:%h 4da45bef \
      | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
    4da45be
    7134973

    In addition, any unrecognized string that has a % in it is interpreted as if it has tformat: in front of it. For example, these two are equivalent:さらに、内にある認識されない文字列は、その前にある%かのように解釈されtformat:ます。たとえば、これら2つは同等です。

    $ git log -2 --pretty=tformat:%h 4da45bef
    $ git log -2 --pretty=%h 4da45bef

COMMON DIFF OPTIONS共通DIFFオプション

-p
-u
--patch - パッチ

Generate patch (see section on generating patches).パッチを生成します(パッチの生成に関する節を見てください)。

-s
--no-patch

Suppress diff output. Useful for commands like git show that show the patch by default, or to cancel the effect of --patch.差分出力を抑制します。git showそのようなコマンドにデフォルトでパッチを表示したり、の効果をキャンセルしたりするのに便利です--patch

-U<n> -U <n>
--unified=<n> --unified = <n>

Generate diffs with <n> lines of context instead of the usual three. Implies -p.通常の3行ではなく<n>行のコンテキストでdiffを生成します。ほのめかし-pます。

--raw - 生

For each commit, show a summary of changes using the raw diff format. See the "RAW OUTPUT FORMAT" section of git-diff[1]. This is different from showing the log itself in raw format, which you can achieve with --format=raw.コミットごとに、生のdiff形式を使用して変更の要約を表示します。git-diff [1]の "RAW OUTPUT FORMAT"セクションを参照してください。これは、ログ自体をそのままの形式で表示するのとは異なります--format=raw

--patch-with-raw

Synonym for -p --raw.の同義語-p --raw

--indent-heuristic

Enable the heuristic that shifts diff hunk boundaries to make patches easier to read. This is the default.パッチを読みやすくするために差分ハンクの境界をシフトするヒューリスティックを有効にします。これがデフォルトです。

--no-indent-heuristic

Disable the indent heuristic.インデントヒューリスティックを無効にします。

--minimal - 最小

Spend extra time to make sure the smallest possible diff is produced.可能な限り最小の差分が生成されるように、余分な時間をかけてください。

--patience - おしゃべり

Generate a diff using the "patience diff" algorithm."patience diff"アルゴリズムを使って差分を生成します。

--histogram - ヒストグラム

Generate a diff using the "histogram diff" algorithm."histogram diff"アルゴリズムを使って差分を生成します。

--anchored=<text> --anchored = <テキスト>

Generate a diff using the "anchored diff" algorithm.「アンカー付き差分」アルゴリズムを使用して差分を生成します。

This option may be specified more than once.このオプションは複数回指定できます。

If a line exists in both the source and destination, exists only once, and starts with this text, this algorithm attempts to prevent it from appearing as a deletion or addition in the output. It uses the "patience diff" algorithm internally.行がソースとデスティネーションの両方に存在し、1回だけ存在し、このテキストで始まる場合、このアルゴリズムはその行が削除または追加として出力に表示されないようにします。内部的に "patience diff"アルゴリズムを使用しています。

--diff-algorithm={patience|minimal|histogram|myers} --diff-algorithm = {patience | minimal | histogram | myers}

Choose a diff algorithm. The variants are as follows:差分アルゴリズムを選択してください。バリアントは以下のとおりです。

default, myers defaultmyers

The basic greedy diff algorithm. Currently, this is the default.基本的な欲張りな差分アルゴリズム。現在、これがデフォルトです。

minimal

Spend extra time to make sure the smallest possible diff is produced.可能な限り最小の差分が生成されるように、余分な時間をかけてください。

patience

Use "patience diff" algorithm when generating patches.パッチを生成するときは "patience diff"アルゴリズムを使用してください。

histogram

This algorithm extends the patience algorithm to "support low-occurrence common elements".このアルゴリズムは、忍耐度アルゴリズムを「発生頻度の低い共通要素をサポートする」ように拡張したものです。

For instance, if you configured the diff.algorithm variable to a non-default value and want to use the default one, then you have to use --diff-algorithm=default option.たとえば、diff.algorithm変数をデフォルト以外の値に設定し、デフォルトの値を使用したい場合は、--diff-algorithm=defaultoption を使用する必要があります。

--stat[=<width>[,<name-width>[,<count>]]] --stat [= <幅> [、<名前 - 幅> [、<数>]]]

Generate a diffstat. By default, as much space as necessary will be used for the filename part, and the rest for the graph part. Maximum width defaults to terminal width, or 80 columns if not connected to a terminal, and can be overridden by <width>. The width of the filename part can be limited by giving another width <name-width> after a comma. The width of the graph part can be limited by using --stat-graph-width=<width> (affects all commands generating a stat graph) or by setting diff.statGraphWidth=<width> (does not affect git format-patch). By giving a third parameter <count>, you can limit the output to the first <count> lines, followed by ... if there are more.diffstatを生成します。デフォルトでは、必要なだけのスペースがファイル名部分に使用され、残りの部分はグラフ部分に使用されます。最大幅はデフォルトで端末幅に設定され<width>ます。端末に接続されていない場合は80桁になります。ファイル名部分の幅は、<name-width>コンマの後に別の幅を指定することで制限できます。グラフの部分の幅は、使用することによって制限することができる--stat-graph-width=<width>(STATグラフを生成するすべてのコマンドに影響を与える)、または設定してdiff.statGraphWidth=<width>(影響を与えませんgit format-patch)。3番目のパラメータを指定<count>することで、最初の<count>行に出力を制限し、その後にさらに出力がある...場合はそれに続けます。

These parameters can also be set individually with --stat-width=<width>, --stat-name-width=<name-width> and --stat-count=<count>.これらのパラメータは、またして個別に設定することができ--stat-width=<width>--stat-name-width=<name-width>そして--stat-count=<count>

--compact-summary

Output a condensed summary of extended header information such as file creations or deletions ("new" or "gone", optionally "+l" if it’s a symlink) and mode changes ("+x" or "-x" for adding or removing executable bit respectively) in diffstat. The information is put between the filename part and the graph part. Implies --stat.ファイルの作成や削除( "new"または "gone"、オプションで "+ l"、シンボリックリンクの場合はオプションの "+ l"など)やモードの変更(追加または削除の場合は "+ x"や "-x")などの拡張ヘッダー情報の要約を出力します。 diffstatの実行可能ビット)情報はファイル名部分とグラフ部分の間に置かれます。ほのめかし--statます。

--numstat

Similar to --stat, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly. For binary files, outputs two - instead of saying 0 0.に似て--statいますが、追加された行と削除された行の数を10進表記とパス名で表示します。バイナリファイルの場合は、-言う代わりに2 を出力します0 0

--shortstat

Output only the last line of the --stat format containing total number of modified files, as well as number of added and deleted lines.--stat変更されたファイルの総数と、追加された行と削除された行の数を含むフォーマットの最後の行だけを出力します。

--dirstat[=<param1,param2,…​>] --dirstat [= <param1、param2、…>]

Output the distribution of relative amount of changes for each sub-directory. The behavior of --dirstat can be customized by passing it a comma separated list of parameters. The defaults are controlled by the diff.dirstat configuration variable (see git-config[1]). The following parameters are available:各サブディレクトリの相対的な変更量の分布を出力します。の振る舞いは--dirstat、パラメータのコンマ区切りのリストを渡すことでカスタマイズできます。デフォルトはdiff.dirstat設定変数によって制御されます(git-config [1]参照)。以下のパラメータが利用可能です。

changes

Compute the dirstat numbers by counting the lines that have been removed from the source, or added to the destination. This ignores the amount of pure code movements within a file. In other words, rearranging lines in a file is not counted as much as other changes. This is the default behavior when no parameter is given.転送元から削除された行、または転送先に追加された行をカウントして、dirstat番号を計算します。これはファイル内の純粋なコードの移動量を無視します。つまり、ファイル内の行の並べ替えは、他の変更ほどにはカウントされません。これは、パラメータが指定されていない場合のデフォルトの動作です。

lines

Compute the dirstat numbers by doing the regular line-based diff analysis, and summing the removed/added line counts. (For binary files, count 64-byte chunks instead, since binary files have no natural concept of lines). This is a more expensive --dirstat behavior than the changes behavior, but it does count rearranged lines within a file as much as other changes. The resulting output is consistent with what you get from the other --*stat options.通常の行ベースの差分分析を行い、削除/追加された行数を合計することによって、dirstat数を計算します。(バイナリファイルの場合、バイナリファイルには行の自然な概念がないため、代わりに64バイトのチャンクを数えてください)。これは--dirstat動作よりも高価な動作ですが、changes他の変更と同じくらいファイル内の再配置された行をカウントします。結果の出力は、他の--*statオプションから得られるものと一致しています。

files

Compute the dirstat numbers by counting the number of files changed. Each changed file counts equally in the dirstat analysis. This is the computationally cheapest --dirstat behavior, since it does not have to look at the file contents at all.変更されたファイルの数を数えることによってdirstat番号を計算します。それぞれの変更されたファイルは、嫌悪感分析において等しく数えられます。--dirstatファイルの内容をまったく調べる必要がないため、これは計算上最も安価な動作です。

cumulative

Count changes in a child directory for the parent directory as well. Note that when using cumulative, the sum of the percentages reported may exceed 100%. The default (non-cumulative) behavior can be specified with the noncumulative parameter.親ディレクトリの子ディレクトリの変更もカウントします。使用時cumulativeに、報告されたパーセンテージの合計が100%を超える可能性があることに注意してください。デフォルトの(非累積的な)振る舞いはnoncumulativeパラメータで指定できます。

<limit>

An integer parameter specifies a cut-off percent (3% by default). Directories contributing less than this percentage of the changes are not shown in the output.整数パラメータは、カットオフパーセント(デフォルトでは3%)を指定します。この割合より少ない変更を提供しているディレクトリは、出力には表示されません。

Example: The following will count changed files, while ignoring directories with less than 10% of the total amount of changed files, and accumulating child directory counts in the parent directories: --dirstat=files,10,cumulative.例:以下は、変更されたファイルの総数の10%未満のディレクトリを無視し、変更されたファイルを数え、親ディレクトリに子ディレクトリの数を累積します--dirstat=files,10,cumulative

--summary - 概要

Output a condensed summary of extended header information such as creations, renames and mode changes.作成、名前変更、モード変更などの拡張ヘッダー情報の要約を出力します。

--patch-with-stat

Synonym for -p --stat.の同義語-p --stat

-z

Separate the commits with NULs instead of with new newlines.コミットを改行ではなくNULで区切ってください。

Also, when --raw or --numstat has been given, do not munge pathnames and use NULs as output field terminators.また、与えられたとき--raw--numstat与えられたときは、パス名を曖昧にしたり、出力フィールドの終端文字としてNULを使用したりしないでください。

Without this option, pathnames with "unusual" characters are quoted as explained for the configuration variable core.quotePath (see git-config[1]).このオプションを指定しないと、 "変わった"文字を含むパス名は、構成変数で説明されているように引用符で囲まれますcore.quotePathgit-config [1]を参照)。

--name-only

Show only names of changed files.変更されたファイルの名前だけを表示します。

--name-status

Show only names and status of changed files. See the description of the --diff-filter option on what the status letters mean.変更されたファイルの名前とステータスだけを表示します。--diff-filterステータス文字の意味については、オプションの説明を参照してください。

--submodule[=<format>] --submodule [= <フォーマット>]

Specify how differences in submodules are shown. When specifying --submodule=short the short format is used. This format just shows the names of the commits at the beginning and end of the range. When --submodule or --submodule=log is specified, the log format is used. This format lists the commits in the range like git-submodule[1] summary does. When --submodule=diff is specified, the diff format is used. This format shows an inline diff of the changes in the submodule contents between the commit range. Defaults to diff.submodule or the short format if the config option is unset.サブモジュールの違いをどのように表示するかを指定します。指定する場合、短い形式が使用されます。このフォーマットは単に範囲の最初と最後のコミットの名前を表示します。またはが指定されている場合は、ログ形式が使用されます。このフォーマットはgit-submodule [1]のように範囲内のコミットをリストします。を指定した場合は、diff形式が使用されます。このフォーマットは、コミット範囲間のサブモジュールの内容の変化のインライン差分を示しています。configオプションが設定されていない場合は、デフォルトのまたは短い形式になります。--submodule=short--submodule--submodule=log summary--submodule=diffdiff.submodule

--color[=<when>] --color [= <when>]

Show colored diff. --color (i.e. without =<when>) is the same as --color=always. <when> can be one of always, never, or auto.色付きの差分を表示します。--color(すなわちwithout = <when>はと同じ--color=alwaysです。<とき>のいずれかにすることができalwaysneverまたはauto

--no-color - 色なし

Turn off colored diff. It is the same as --color=never.色付きの差分をオフにします。と同じ--color=neverです。

--color-moved[=<mode>] --color-moved [= <モード>]

Moved lines of code are colored differently. The <mode> defaults to no if the option is not given and to zebra if the option with no mode is given. The mode must be one of:移動したコード行は異なる色で表示されます。オプションが指定されていない場合、<mode>のデフォルトはnoで、モードが指定されていないオプションが指定されている場合はzebraです。モードは次のいずれかでなければなりません。

no いいえ

Moved lines are not highlighted.移動した行は強調表示されません。

default デフォルト

Is a synonym for zebra. This may change to a more sensible mode in the future.の同義語ですzebra。これは将来より賢明なモードに変わるかもしれません。

plain 平野

Any line that is added in one location and was removed in another location will be colored with color.diff.newMoved. Similarly color.diff.oldMoved will be used for removed lines that are added somewhere else in the diff. This mode picks up any moved line, but it is not very useful in a review to determine if a block of code was moved without permutation.ある場所で追加され、別の場所で削除された行は、color.diff.newMovedで色付けされます。同様に、color.diff.oldMovedは差分の他の場所に追加された削除された行に使用されます。このモードは移動された行を拾いますが、コードブロックが置換なしで移動されたかどうかを判断するのにレビューではあまり役に立ちません。

blocks ブロック

Blocks of moved text of at least 20 alphanumeric characters are detected greedily. The detected blocks are painted using either the color.diff.{old,new}Moved color. Adjacent blocks cannot be told apart.少なくとも20文字の英数字の移動されたテキストのブロックは貪欲に検出されます。検出されたブロックは、color.diff。{old、new}のいずれかのを使って描画されます。隣接するブロックを区別することはできません。

zebra シマウマ

Blocks of moved text are detected as in blocks mode. The blocks are painted using either the color.diff.{old,new}Moved color or color.diff.{old,new}MovedAlternative. The change between the two colors indicates that a new block was detected.移動されたテキストのブロックはブロックモードのように検出されます。ブロックは、color.diff。{old、new} Moved colorまたはcolor.diff。{old、new} MovedAlternativeのいずれかを使用して描画されます。2色の変化は、新しいブロックが検出されたことを示します。

dimmed-zebra 薄暗いシマウマ

Similar to zebra, but additional dimming of uninteresting parts of moved code is performed. The bordering lines of two adjacent blocks are considered interesting, the rest is uninteresting. dimmed_zebra is a deprecated synonym.シマウマと似ていますが、動かされたコードの興味のない部分の追加の調光が行われます。2つの隣接するブロックの境界線は興味深いと考えられています、残りは面白くありません。dimmed_zebra非推奨の同義語です。

--no-color-moved - no-color-moved

Turn off move detection. This can be used to override configuration settings. It is the same as --color-moved=no.動き検出をオフにします。これを使用して構成設定を上書きできます。と同じ--color-moved=noです。

--color-moved-ws=<modes> --color-moved-ws = <モード>

This configures how whitespace is ignored when performing the move detection for --color-moved. These modes can be given as a comma separated list:これは、移動検出を実行するときに空白を無視する方法を設定します--color-moved。これらのモードは、コンマ区切りのリストとして指定できます。

no いいえ

Do not ignore whitespace when performing move detection.移動検出を実行するときに空白を無視しないでください。

ignore-space-at-eol

Ignore changes in whitespace at EOL.EOLで空白の変更を無視します。

ignore-space-change 無視スペース変更

Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent.空白の量の変化を無視します。これは行末の空白を無視し、1つ以上の空白文字の他のすべてのシーケンスを等価と見なします。

ignore-all-space 全スペースを無視

Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none.行を比較するときに空白を無視します。片方の行に空白があり、もう一方の行に空白がない場合でも、これは違いを無視します。

allow-indentation-change 許可 - インデント - 変更

Initially ignore any whitespace in the move detection, then group the moved code blocks only into a block if the change in whitespace is the same per line. This is incompatible with the other modes.最初に移動検出で空白を無視し、空白の変化が行ごとに同じである場合は、移動されたコードブロックをブロックにのみグループ化します。これは他のモードと互換性がありません。

--no-color-moved-ws

Do not ignore whitespace when performing move detection. This can be used to override configuration settings. It is the same as --color-moved-ws=no.移動検出を実行するときに空白を無視しないでください。これを使用して構成設定を上書きできます。と同じ--color-moved-ws=noです。

--word-diff[=<mode>] --word-diff [= <モード>]

Show a word diff, using the <mode> to delimit changed words. By default, words are delimited by whitespace; see --word-diff-regex below. The <mode> defaults to plain, and must be one of:変更された単語を区切るために<mode>を使用して単語diffを表示します。デフォルトでは、単語は空白で区切られています。下記を参照してください--word-diff-regex。<mode>のデフォルトはplainで、次のいずれかでなければなりません。

color

Highlight changed words using only colors. Implies --color.色だけを使って変更された単語を強調表示します。ほのめかし--colorます。

plain 平野

Show words as [-removed-] and {+added+}. Makes no attempts to escape the delimiters if they appear in the input, so the output may be ambiguous.[-removed-]ととして単語を表示します{+added+}。区切り文字が入力に含まれている場合は、区切り文字をエスケープしようとしないため、出力があいまいになる可能性があります。

porcelain 磁器

Use a special line-based format intended for script consumption. Added/removed/unchanged runs are printed in the usual unified diff format, starting with a +/-/` ` character at the beginning of the line and extending to the end of the line. Newlines in the input are represented by a tilde ~ on a line of its own.スクリプトを使用するための特別な行ベースの形式を使用してください。追加/削除/変更されていない実行は、行の先頭の+/ -/ ``文字で始まり行の終わりまで続き、通常のunified diff形式で表示されます。入力の改行は、~それ自身の行の上のティルダで表されます。

none 無し

Disable word diff again.単語diffを再び無効にします。

Note that despite the name of the first mode, color is used to highlight the changed parts in all modes if enabled.最初のモードの名前にかかわらず、有効になっている場合は、すべてのモードで変更部分を強調するために色が使用されます。

--word-diff-regex=<regex> --word-diff-regex = <正規表現>

Use <regex> to decide what a word is, instead of considering runs of non-whitespace to be a word. Also implies --word-diff unless it was already enabled.非空白文字の並びを単語と見なすのではなく、<regex>を使用して単語を決定します。--word-diffすでに有効になっていない限り、これも意味します。

Every non-overlapping match of the <regex> is considered a word. Anything between these matches is considered whitespace and ignored(!) for the purposes of finding differences. You may want to append |[^[:space:]] to your regular expression to make sure that it matches all non-whitespace characters. A match that contains a newline is silently truncated(!) at the newline.<regex>の重複しない一致はすべて単語と見なされます。これらの一致の間にあるものはすべて空白と見なされ、違いを見つける目的で無視されます(!)。|[^[:space:]]正規表現に追加して、空白以外のすべての文字と確実に一致させることができます。改行を含む一致は、改行時に暗黙のうちに切り捨てられます(!)。

For example, --word-diff-regex=. will treat each character as a word and, correspondingly, show differences character by character.たとえば、--word-diff-regex=.各文字を単語として扱い、それに応じて文字ごとに違いを表示します。

The regex can also be set via a diff driver or configuration option, see gitattributes[5] or git-config[1]. Giving it explicitly overrides any diff driver or configuration setting. Diff drivers override configuration settings.正規表現はdiffドライバや設定オプションで設定することもできます。gitattributes[5]またはgit-config [1]を参照してください。明示的に与えると、diffドライバや設定の設定を上書きします。差分ドライバは構成設定を上書きします。

--color-words[=<regex>] --color-words [= <正規表現>]

Equivalent to --word-diff=color plus (if a regex was specified) --word-diff-regex=<regex>.--word-diff=colorplusと同等です(正規表現が指定されている場合)--word-diff-regex=<regex>

--no-renames

Turn off rename detection, even when the configuration file gives the default to do so.設定ファイルがデフォルトを指定している場合でも、名前の変更の検出を無効にします。

--check - チェック

Warn if changes introduce conflict markers or whitespace errors. What are considered whitespace errors is controlled by core.whitespace configuration. By default, trailing whitespaces (including lines that consist solely of whitespaces) and a space character that is immediately followed by a tab character inside the initial indent of the line are considered whitespace errors. Exits with non-zero status if problems are found. Not compatible with --exit-code.変更によって競合マーカーまたは空白エラーが発生するかどうかを警告します。空白エラーと見なされるものはcore.whitespace構成によって制御されます。デフォルトでは、末尾の空白(空白のみで構成される行を含む)およびその行の最初のインデントの内側にタブ文字が直後に続く空白文字は空白エラーと見なされます。問題が見つかった場合は、ゼロ以外のステータスで終了します。--exit-codeと互換性がありません。

--ws-error-highlight=<kind> --ws-error-highlight = <種類>

Highlight whitespace errors in the context, old or new lines of the diff. Multiple values are separated by comma, none resets previous values, default reset the list to new and all is a shorthand for old,new,context. When this option is not given, and the configuration variable diff.wsErrorHighlight is not set, only whitespace errors in new lines are highlighted. The whitespace errors are colored with color.diff.whitespace.差分のcontextoldまたは行内の空白エラーを強調表示しますnew。複数の値は、コンマによって分離されるnone前の値をリセットし、defaultにリストをリセットnewallの省略形ですold,new,context。このオプションが指定されておらず、設定変数diff.wsErrorHighlightが設定されていない場合、行内の空白エラーのみnewが強調表示されます。空白エラーは色付きcolor.diff.whitespaceです。

--full-index

Instead of the first handful of characters, show the full pre- and post-image blob object names on the "index" line when generating patch format output.最初の一握りの文字の代わりに、パッチフォーマットの出力を生成するときに、 "index"行に完全なプリイメージとポストイメージのBLOBオブジェクト名を表示します。

--binary - バイナリ

In addition to --full-index, output a binary diff that can be applied with git-apply.に加えて--full-index、適用できるバイナリ差分を出力しgit-applyます。

--abbrev[=<n>] --abbrev [= <n>]

Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header lines, show only a partial prefix. This is independent of the --full-index option above, which controls the diff-patch output format. Non default number of digits can be specified with --abbrev=<n>.diff-raw形式の出力とdiff-treeヘッダー行に完全な40バイトの16進数のオブジェクト名を表示する代わりに、部分的なプレフィックスのみを表示します。これは--full-index、diff-patchの出力フォーマットを制御する上記のオプションとは無関係です。デフォルト以外の桁数をで指定できます--abbrev=<n>

-B[<n>][/<m>] -B [<n>] [/ <m>]
--break-rewrites[=[<n>][/<m>]] --break-rewritees [= [<n>] [/ <m>]]

Break complete rewrite changes into pairs of delete and create. This serves two purposes:完全な書き換えの変更を削除と作成のペアに分割します。これには2つの目的があります。

It affects the way a change that amounts to a total rewrite of a file not as a series of deletion and insertion mixed together with a very few lines that happen to match textually as the context, but as a single deletion of everything old followed by a single insertion of everything new, and the number m controls this aspect of the -B option (defaults to 60%). -B/70% specifies that less than 30% of the original should remain in the result for Git to consider it a total rewrite (i.e. otherwise the resulting patch will be a series of deletion and insertion mixed together with context lines).それは、文脈としてテキスト的に一致することが起こる非常に少数の行と混合された一連の削除と挿入としてではなく、ファイルの完全な書き換えに相当する変更に影響する方法に影響します。新しいものすべてを1回挿入mすると、その数によって-Bオプションのこの側面が制御されます(デフォルトは60%)。-B/70%Gitが完全な書き換えと見なすには、元の30%未満を結果に残すように指定します(そうでなければ、結果として得られるパッチは、一連の削除と挿入がコンテキスト行と混在したものになります)。

When used with -M, a totally-rewritten file is also considered as the source of a rename (usually -M only considers a file that disappeared as the source of a rename), and the number n controls this aspect of the -B option (defaults to 50%). -B20% specifies that a change with addition and deletion compared to 20% or more of the file’s size are eligible for being picked up as a possible source of a rename to another file.-Mと一緒に使用すると、完全に書き換えられたファイルも名前変更のソースと見なされ(通常、-Mは、名前変更のソースとして表示されなくなったファイルのみを考慮します)、- nBオプションのこの側面を制御します。デフォルトは50%です。-B20%ファイルのサイズの20%以上と比較した追加および削除による変更が、別のファイルへの名前変更の可能性のあるソースとして選択されるのに適格であることを指定します。

-M[<n>] -M [<n>]
--find-renames[=<n>] --find-renames [= <n>]

If generating diffs, detect and report renames for each commit. For following files across renames while traversing history, see --follow. If n is specified, it is a threshold on the similarity index (i.e. amount of addition/deletions compared to the file’s size). For example, -M90% means Git should consider a delete/add pair to be a rename if more than 90% of the file hasn’t changed. Without a % sign, the number is to be read as a fraction, with a decimal point before it. I.e., -M5 becomes 0.5, and is thus the same as -M50%. Similarly, -M05 is the same as -M5%. To limit detection to exact renames, use -M100%. The default similarity index is 50%.差分を生成する場合は、コミットごとに名前の変更を検出して報告します。履歴をたどりながら名前を変えてファイルを追跡するには、を見てください--follown指定されている場合、それは類似性インデックス(つまり、ファイルのサイズと比較した追加/削除の量)に関するしきい値です。たとえば-M90%、ファイルの90%以上が変更されていない場合、Gitは削除/追加のペアを名前の変更と見なす必要があります。%符号なしの場合、数値は小数点の前に小数部として読み取られます。すなわち、-M50.5 になるので、と同じ-M50%です。同様に、-M05と同じ-M5%です。検出を正確な名前変更に限定するには、を使用します-M100%。デフォルトの類似度は50%です。

-C[<n>] -C [<n>]
--find-copies[=<n>] --find-copies [= <n>]

Detect copies as well as renames. See also --find-copies-harder. If n is specified, it has the same meaning as for -M<n>.コピーと名前の変更を検出します。もご覧ください--find-copies-hardernを指定した場合は、と同じ意味になり-M<n>ます。

--find-copies-harder

For performance reasons, by default, -C option finds copies only if the original file of the copy was modified in the same changeset. This flag makes the command inspect unmodified files as candidates for the source of copy. This is a very expensive operation for large projects, so use it with caution. Giving more than one -C option has the same effect.パフォーマンス上の理由から、デフォルトで-Cは、コピーの元のファイルが同じチェンジセット内で変更されている場合にのみコピーが検索されます。このフラグは、コピー元の候補として未修正のファイルを検査します。これは大規模プロジェクトでは非常に高価な操作なので、慎重に使用してください。複数の-Cオプションを指定しても同じ効果があります。

-D
--irreversible-delete

Omit the preimage for deletes, i.e. print only the header but not the diff between the preimage and /dev/null. The resulting patch is not meant to be applied with patch or git apply; this is solely for people who want to just concentrate on reviewing the text after the change. In addition, the output obviously lacks enough information to apply such a patch in reverse, even manually, hence the name of the option.削除のためにpreimageを省略してください、すなわち、preimageとの間の差分ではなくヘッダーだけを印刷してください/dev/null。得られたパッチが適用されることを意図されていないpatch、またはgit apply、これは、変更後のテキストを見直すことに専念したい人のためだけのものです。さらに、そのようなパッチを手動でも逆に適用するのに十分な情報が出力に欠けているため、オプションの名前です。

When used together with -B, omit also the preimage in the deletion part of a delete/create pair.一緒に使用する場合-Bは、削除/作成ペアの削除部分のプレイメージも省略します。

-l<num> -l <番号>

The -M and -C options require O(n^2) processing time where n is the number of potential rename/copy targets. This option prevents rename/copy detection from running if the number of rename/copy targets exceeds the specified number.-Mそして-Cオプションは、nは電位リネーム/コピー標的の数はO(N ^ 2)の処理時間を必要とします。このオプションは、名前変更/コピーターゲットの数が指定された数を超えた場合に名前変更/コピー検出が実行されないようにします。

--diff-filter=[(A|C|D|M|R|T|U|X|B)…​[*]] --diff-filter = [(A | C | D | M | R | T | U | X | B)…[*]]

Select only files that are Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R), have their type (i.e. regular file, symlink, submodule, …​) changed (T), are Unmerged (U), are Unknown (X), or have had their pairing Broken (B). Any combination of the filter characters (including none) can be used. When * (All-or-none) is added to the combination, all paths are selected if there is any file that matches other criteria in the comparison; if there is no file that matches other criteria, nothing is selected.追加(A)、コピー(C)、削除(D)、変更(M)、名前変更(R)、タイプ(通常ファイル、シンボリックリンク、サブモジュールなど)が変更されている(T)、Unmerged(U)であるファイルのみを選択します。不明(X)、またはペアリングが壊れている(B)。フィルタ文字の任意の組み合わせ(なしを含む)を使用できます。場合*(全か無か)の組み合わせに添加する比較して他の基準に一致するすべてのファイルが存在する場合、すべてのパスが選択されます。他の基準に一致するファイルがない場合は、何も選択されません。

Also, these upper-case letters can be downcased to exclude. E.g. --diff-filter=ad excludes added and deleted paths.また、これらの大文字は除外するために小文字にすることができます。例えば--diff-filter=ad追加されたパスや削除されたパスを除外します。

Note that not all diffs can feature all types. For instance, diffs from the index to the working tree can never have Added entries (because the set of paths included in the diff is limited by what is in the index). Similarly, copied and renamed entries cannot appear if detection for those types is disabled.すべての差分がすべての型を扱えるわけではないことに注意してください。たとえば、インデックスから作業ツリーへの差分は、追加エントリを持つことはできません(差分に含まれるパスのセットは、インデックスに含まれるものによって制限されるため)。同様に、これらのタイプの検出が無効になっていると、コピーして名前を変更したエントリーは表示されません。

-S<string> -S <文字列>

Look for differences that change the number of occurrences of the specified string (i.e. addition/deletion) in a file. Intended for the scripter’s use.ファイル内の指定された文字列の出現回数(すなわち追加/削除)を変更する違いを探します。スクリプト作成者の使用を目的としています。

It is useful when you’re looking for an exact block of code (like a struct), and want to know the history of that block since it first came into being: use the feature iteratively to feed the interesting block in the preimage back into -S, and keep going until you get the very first version of the block.コードの正確なブロック(構造体など)を探していて、そのブロックが最初に登場してからの履歴を知りたい場合に便利です。プレイメージの中の興味深いブロックを繰り返し使用することで、-Sそして、あなたがブロックの一番最初のバージョンを手に入れるまで続けてください。

Binary files are searched as well.バイナリファイルも検索されます。

-G<regex> -G <正規表現>

Look for differences whose patch text contains added/removed lines that match <regex>.パッチテキストに<regex>と一致する追加/削除された行が含まれている違いを探します。

To illustrate the difference between -S<regex> --pickaxe-regex and -G<regex>, consider a commit with the following diff in the same file:-S<regex> --pickaxe-regexとの違いを説明するため-G<regex>に、同じファイル内で次のdiffを使用したコミットを考えます。

+    return !regexec(regexp, two->ptr, 1, &regmatch, 0);
...
-    hit = !regexec(regexp, mf2.ptr, 1, &regmatch, 0);

While git log -G"regexec\(regexp" will show this commit, git log -S"regexec\(regexp" --pickaxe-regex will not (because the number of occurrences of that string did not change).一方ではgit log -G"regexec\(regexp"、このコミット表示されますgit log -S"regexec\(regexp" --pickaxe-regex(その文字列の出現回数が変更されていないので)ではないでしょう。

Unless --text is supplied patches of binary files without a textconv filter will be ignored.--texttextconvフィルタのないバイナリファイルのパッチが提供されていない限り無視されます。

See the pickaxe entry in gitdiffcore[7] for more information.詳細についてはgitdiffcore [7]pickaxeエントリを参照してください。

--find-object=<object-id> --find-object = <オブジェクトID>

Look for differences that change the number of occurrences of the specified object. Similar to -S, just the argument is different in that it doesn’t search for a specific string but for a specific object id.指定されたオブジェクトの出現回数を変更する違いを探します。と同様に-S、引数は、特定の文字列ではなく特定のオブジェクトIDを検索するという点で異なります。

The object can be a blob or a submodule commit. It implies the -t option in git-log to also find trees.オブジェクトはBLOBまたはサブモジュールのコミットです。それは木も見つけるための-t選択肢を意味しますgit-log

--pickaxe-all

When -S or -G finds a change, show all the changes in that changeset, not just the files that contain the change in <string>.とき-Sまたは-G変更を見つけ、そのチェンジ内のすべての変更、<文字列>の変化が含まれていないファイルだけを表示します。

--pickaxe-regex

Treat the <string> given to -S as an extended POSIX regular expression to match.に与えられた<string>を-S拡張POSIX正規表現として扱います。

-O<orderfile> -O <orderfile>

Control the order in which files appear in the output. This overrides the diff.orderFile configuration variable (see git-config[1]). To cancel diff.orderFile, use -O/dev/null.出力に表示されるファイルの順序を制御します。これはdiff.orderFile設定変数を上書きします(git-config [1]を参照)。キャンセルするにdiff.orderFileはを使用してください-O/dev/null

The output order is determined by the order of glob patterns in <orderfile>. All files with pathnames that match the first pattern are output first, all files with pathnames that match the second pattern (but not the first) are output next, and so on. All files with pathnames that do not match any pattern are output last, as if there was an implicit match-all pattern at the end of the file. If multiple pathnames have the same rank (they match the same pattern but no earlier patterns), their output order relative to each other is the normal order.出力順序は、<orderfile>内のglobパターンの順序によって決まります。最初のパターンと一致するパス名を持つすべてのファイルが最初に出力され、2番目のパターンと一致するが最初のパターンと一致しないパス名を持つすべてのファイルが次に出力されます。どのパターンとも一致しないパス名を持つすべてのファイルは、あたかもファイルの終わりに暗黙の全部突き合わせパターンがあったかのように、最後に出力されます。複数のパス名が同じランクを持つ場合(それらは同じパターンに一致しますが、以前のパターンには一致しない場合)、互いに対する相対的な出力順序は通常の順序です。

<orderfile> is parsed as follows:<orderfile>は次のように解析されます。

  • Blank lines are ignored, so they can be used as separators for readability.空白行は無視されるため、読みやすくするために区切り文字として使用できます。

  • Lines starting with a hash ("#") are ignored, so they can be used for comments. Add a backslash ("\") to the beginning of the pattern if it starts with a hash.ハッシュ( " #")で始まる行は無視されるため、コメントに使用できます。\ハッシュで始まる場合は、パターンの先頭に円記号( " ")を追加します。

  • Each other line contains a single pattern.他の各行には単一のパターンが含まれています。

Patterns have the same syntax and semantics as patterns used for fnmatch(3) without the FNM_PATHNAME flag, except a pathname also matches a pattern if removing any number of the final pathname components matches the pattern. For example, the pattern "foo*bar" matches "fooasdfbar" and "foo/bar/baz/asdf" but not "foobarx".パターンは、FNM_PATHNAMEフラグなしでfnmatch(3)に使用されるパターンと同じ構文および意味論を持ちます。ただし、最終パス名の構成要素をいくつでも削除した場合、パス名もパターンと一致する点が異なります。たとえば、パターン " foo*bar"は " fooasdfbar"と " foo/bar/baz/asdf"には一致しますが " "には一致しませんfoobarx

-R

Swap two inputs; that is, show differences from index or on-disk file to tree contents.2つの入力を入れ替えます。つまり、インデックスまたはディスク上のファイルとツリーの内容との違いを示します。

--relative[=<path>] --relative [= <パス>]

When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option. When you are not in a subdirectory (e.g. in a bare repository), you can name which subdirectory to make the output relative to by giving a <path> as an argument.プロジェクトのサブディレクトリから実行すると、ディレクトリ外の変更を除外し、このオプションを使用してディレクトリに対する相対パス名を表示するように指示できます。サブディレクトリにいないとき(例えば、ベアリポジトリ)、引数として<path>を与えることによって、どのサブディレクトリに相対的な出力をするかを指定できます。

-a
--text - テキスト

Treat all files as text.すべてのファイルをテキストとして扱います。

--ignore-cr-at-eol

Ignore carriage-return at the end of line when doing a comparison.比較をするとき、行末での復帰を無視します。

--ignore-space-at-eol

Ignore changes in whitespace at EOL.EOLで空白の変更を無視します。

-b
--ignore-space-change

Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent.空白の量の変化を無視します。これは行末の空白を無視し、1つ以上の空白文字の他のすべてのシーケンスを等価と見なします。

-w
--ignore-all-space

Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none.行を比較するときに空白を無視します。片方の行に空白があり、もう一方の行に空白がない場合でも、これは違いを無視します。

--ignore-blank-lines

Ignore changes whose lines are all blank.すべての行が空白になっている変更を無視します。

--inter-hunk-context=<lines> --inter-hunk-context = <lines>

Show the context between diff hunks, up to the specified number of lines, thereby fusing hunks that are close to each other. Defaults to diff.interHunkContext or 0 if the config option is unset.指定した行数までの差分ハンク間のコンテキストを表示し、それによって互いに近いハンクを融合します。diff.interHunkContextconfigオプションが設定されていない場合、デフォルトは0または0です。

-W
--function-context - 機能コンテキスト

Show whole surrounding functions of changes.変更の周囲の機能全体を表示します。

--ext-diff

Allow an external diff helper to be executed. If you set an external diff driver with gitattributes[5], you need to use this option with git-log[1] and friends.外部のdiffヘルパーを実行できるようにします。gitattributes [5]で外部のdiffドライバを設定した場合は、git-log [1]とその仲間と共にこのオプションを使う必要があります。

--no-ext-diff

Disallow external diff drivers.外部のdiffドライバを許可しません。

--textconv
--no-textconv

Allow (or disallow) external text conversion filters to be run when comparing binary files. See gitattributes[5] for details. Because textconv filters are typically a one-way conversion, the resulting diff is suitable for human consumption, but cannot be applied. For this reason, textconv filters are enabled by default only for git-diff[1] and git-log[1], but not for git-format-patch[1] or diff plumbing commands.バイナリファイルを比較するときに外部テキスト変換フィルタを実行することを許可(または禁止)します。詳細はgitattributes [5]を見てください。textconvフィルタは通常一方向の変換であるため、結果の差分は人間の消費には適していますが、適用することはできません。このため、textconvフィルタは、git-diff [1]およびgit-log [1]に対してのみデフォルトで有効になりますが、git-format-patch [1]またはdiff plumbingコマンドには無効になります。

--ignore-submodules[=<when>] --ignore-submodules [= <when>]

Ignore changes to submodules in the diff generation. <when> can be either "none", "untracked", "dirty" or "all", which is the default. Using "none" will consider the submodule modified when it either contains untracked or modified files or its HEAD differs from the commit recorded in the superproject and can be used to override any settings of the ignore option in git-config[1] or gitmodules[5]. When "untracked" is used submodules are not considered dirty when they only contain untracked content (but they are still scanned for modified content). Using "dirty" ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown (this was the behavior until 1.7.0). Using "all" hides all changes to submodules.差分生成でサブモジュールへの変更を無視します。<when>は、 "none"、 "untracked"、 "dirty"、または "all"のいずれかです。これがデフォルトです。noneを使用すると、追跡されていないファイルまたは変更されたファイルが含まれている場合、またはそのHEADがスーパープロジェクトに記録されたコミットと異なる場合に変更されたサブモジュールが考慮されます。git -config [1]またはgitmodules [ 1]ignoreオプションの設定を上書きするために使用できます。 5]。「追跡されていない」が使用されている場合、サブモジュールは追跡されていないコンテンツのみを含む場合はダーティとは見なされません(ただし、変更されたコンテンツについてはスキャンされます)。"dirty"を使用しても、サブモジュールの作業ツリーに対するすべての変更は無視されます。スーパープロジェクトに保存されているコミットへの変更のみが表示されます(これは1.7.0までの動作でした)。"all"を使用すると、サブモジュールに対するすべての変更が隠されます。

--src-prefix=<prefix> --src-prefix = <prefix>

Show the given source prefix instead of "a/"."a /"の代わりに与えられたソースプレフィックスを表示します。

--dst-prefix=<prefix> --dst-prefix = <prefix>

Show the given destination prefix instead of "b/"."b /"の代わりに与えられた宛先プレフィックスを表示します。

--no-prefix

Do not show any source or destination prefix.送信元または宛先のプレフィックスを表示しません。

--line-prefix=<prefix> --line-prefix = <prefix>

Prepend an additional prefix to every line of output.出力の各行に追加の接頭辞を付けます。

--ita-invisible-in-index

By default entries added by "git add -N" appear as an existing empty file in "git diff" and a new file in "git diff --cached". This option makes the entry appear as a new file in "git diff" and non-existent in "git diff --cached". This option could be reverted with --ita-visible-in-index. Both options are experimental and could be removed in future.デフォルトでは、 "git add -N"で追加されたエントリは、 "git diff"には既存の空のファイルとして、 "git diff --cached"には新しいファイルとして表示されます。このオプションはエントリを "git diff"では新しいファイルとして、 "git diff --cached"では存在しないように見せます。このオプションは元に戻すことができます--ita-visible-in-index。どちらのオプションも実験的であり、将来削除される可能性があります。

For more detailed explanation on these common options, see also gitdiffcore[7].これらの共通オプションに関するより詳細な説明については、gitdiffcore [7]も参照してください。

Generating patches with -p-pによるパッチの生成

When "git-diff-index", "git-diff-tree", or "git-diff-files" are run with a -p option, "git diff" without the --raw option, or "git log" with the "-p" option, they do not produce the output described above; instead they produce a patch file. You can customize the creation of such patches via the GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables."git-diff-index"、 "git-diff-tree"、または "git-diff-files"を-pオプション付きで実行した場合、 "git diff" --rawオプションなし、または "git log"に "-p"を指定した場合オプションとして、それらは上記の出力を生成しません。代わりにパッチファイルを作成します。環境変数を使用してGIT_EXTERNAL_DIFF、そのようなパッチの作成をカスタマイズできGIT_DIFF_OPTSます。

What the -p option produces is slightly different from the traditional diff format:-pオプションが生成するものは、従来のdiff形式とは少し異なります。

  1. It is preceded with a "git diff" header that looks like this:このように見える "git diff"ヘッダが前にあります。

    diff --git a/file1 b/file2

    The a/ and b/ filenames are the same unless rename/copy is involved. Especially, even for a creation or a deletion, /dev/null is not used in place of the a/ or b/ filenames.a/およびb/名前変更/コピーが関与しなければ、ファイル名は同じです。特に、でも作成や削除のために、/dev/nullされていないの代わりに使用するa/か、b/ファイル名。

    When rename/copy is involved, file1 and file2 show the name of the source file of the rename/copy and the name of the file that rename/copy produces, respectively.名前変更/コピーが関与した場合file1file2名前の変更/コピーのソースファイルの名前と/コピーはそれぞれ、生産名前を変更するファイルの名前を表示します。

  2. It is followed by one or more extended header lines:その後に1つ以上の拡張ヘッダー行が続きます。

    old mode <mode>
    new mode <mode>
    deleted file mode <mode>
    new file mode <mode>
    copy from <path>
    copy to <path>
    rename from <path>
    rename to <path>
    similarity index <number>
    dissimilarity index <number>
    index <hash>..<hash> <mode>

    File modes are printed as 6-digit octal numbers including the file type and file permission bits.ファイルモードは、ファイルタイプとファイル許可ビットを含む6桁の8進数として表示されます。

    Path names in extended headers do not include the a/ and b/ prefixes.拡張ヘッダー内のパス名には、a/およびb/プレフィックスは含まれません。

    The similarity index is the percentage of unchanged lines, and the dissimilarity index is the percentage of changed lines. It is a rounded down integer, followed by a percent sign. The similarity index value of 100% is thus reserved for two equal files, while 100% dissimilarity means that no line from the old file made it into the new one.類似度指数は変更されていない行の割合であり、非類似度指数は変更された行の割合です。切り捨てられた整数の後にパーセント記号が続きます。したがって、100%の類似性インデックス値は、2つの等しいファイル用に予約されていますが、100%の非類似性は、古いファイルから新しいファイルに変更された行がないことを意味します。

    The index line includes the SHA-1 checksum before and after the change. The <mode> is included if the file mode does not change; otherwise, separate lines indicate the old and the new mode.インデックス行には、変更前後のSHA-1チェックサムが含まれています。ファイルモードが変更されない場合は、<mode>が含まれます。それ以外の場合、別々の行は新旧のモードを示します。

  3. Pathnames with "unusual" characters are quoted as explained for the configuration variable core.quotePath (see git-config[1])."変わった"文字を含むパス名は、構成変数で説明されているように引用符で囲まれていますcore.quotePathgit-config [1]を参照)。

  4. All the file1 files in the output refer to files before the commit, and all the file2 files refer to files after the commit. It is incorrect to apply each change to each file sequentially. For example, this patch will swap a and b:file1出力内のすべてのファイルはコミット前のfile2ファイルを参照し、すべてのファイルはコミット後のファイルを参照します。各ファイルに各変更を順番に適用するのは正しくありません。たとえば、このパッチはaとbを入れ替えます。

    diff --git a/a b/b
    rename from a
    rename to b
    diff --git a/b b/a
    rename from b
    rename to a

combined diff format複合差分フォーマット

Any diff-generating command can take the -c or --cc option to produce a combined diff when showing a merge. This is the default format when showing merges with git-diff[1] or git-show[1]. Note also that you can give the -m option to any of these commands to force generation of diffs with individual parents of a merge.どのdiff-generationコマンドでも、マージを表示するときに-cor --ccオプションを使用して結合差分を生成できます。これはgit-diff [1]またはgit-show [1]でマージを表示するときのデフォルトのフォーマットです。また-m、マージの個々の親との差分の生成を強制するために、これらのコマンドのいずれかにオプションを与えることができます。

A combined diff format looks like this:組み合わせ差分形式は、次のようになります。

diff --combined describe.c
index fabadb8,cc95eb0..4866510
--- a/describe.c
+++ b/describe.c
@@@ -98,20 -98,12 +98,20 @@@
	return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
  }
- static void describe(char *arg)
 -static void describe(struct commit *cmit, int last_one)
++static void describe(char *arg, int last_one)
  {
 +	unsigned char sha1[20];
 +	struct commit *cmit;
	struct commit_list *list;
	static int initialized = 0;
	struct commit_name *n;
 +	if (get_sha1(arg, sha1) < 0)
 +		usage(describe_usage);
 +	cmit = lookup_commit_reference(sha1);
 +	if (!cmit)
 +		usage(describe_usage);
 +
	if (!initialized) {
		initialized = 1;
		for_each_ref(get_name);
  1. It is preceded with a "git diff" header, that looks like this (when -c option is used):これは "git diff"ヘッダが前に-c付きます。これは次のようになります(オプションが使用されている場合)。

    diff --combined file

    or like this (when --cc option is used):または(--ccオプションが使用されている場合)このように:

    diff --cc file
  2. It is followed by one or more extended header lines (this example shows a merge with two parents):その後に1つ以上の拡張ヘッダー行が続きます(この例は、2つの親とのマージを示しています)。

    index <hash>,<hash>..<hash>
    mode <mode>,<mode>..<mode>
    new file mode <mode>
    deleted file mode <mode>,<mode>

    The mode <mode>,<mode>..<mode> line appears only if at least one of the <mode> is different from the rest. Extended headers with information about detected contents movement (renames and copying detection) are designed to work with diff of two <tree-ish> and are not used by combined diff format.このmode <mode>,<mode>..<mode>行は、少なくとも1つの<mode>が他のものと異なる場合にのみ表示されます。検出されたコンテンツの移動に関する情報(名前の変更とコピーの検出)を含む拡張ヘッダーは、2つの<tree-ish>のdiffで機能するように設計されており、複合diff形式では使用されません。

  3. It is followed by two-line from-file/to-file headerその後に2行のファイルから/ファイルへのヘッダーが続きます。

    --- a/file
    +++ b/file

    Similar to two-line header for traditional unified diff format, /dev/null is used to signal created or deleted files.伝統的なunified diff形式の2行のヘッダと同様に、/dev/null作成または削除されたファイルを知らせるために使用されます。

  4. Chunk header format is modified to prevent people from accidentally feeding it to patch -p1. Combined diff format was created for review of merge commit changes, and was not meant for apply. The change is similar to the change in the extended index header:チャンクヘッダーのフォーマットは、人々が誤ってそれにフィードするのを防ぐために修正されていpatch -p1ます。結合差分フォーマットは、マージコミットの変更を確認するために作成されたものであり、適用するためのものではありません。この変更は、拡張インデックスヘッダの変更と似ています。

    @@@ <from-file-range> <from-file-range> <to-file-range> @@@

    There are (number of parents + 1) @ characters in the chunk header for combined diff format.@複合差分フォーマットのチャンクヘッダには(親の数+ 1)文字があります。

Unlike the traditional unified diff format, which shows two files A and B with a single column that has - (minus — appears in A but removed in B), + (plus — missing in A but added to B), or " " (space — unchanged) prefix, this format compares two or more files file1, file2,…​ with one file X, and shows how X differs from each of fileN. One column for each of fileN is prepended to the output line to note how X’s line is different from it.(マイナス - Aでは表示されているがBでは削除されている)または(スペース - 変更されていない)を持つ単一の列を持つ2つのファイルAおよびBを示す従来のunified diff形式とは異なります。接頭辞、この形式は複数のファイルfile1、file2、…を1つのファイルXと比較し、XがfileNのそれぞれとどう違うかを示します。Xの行がそれとどのように異なるかを確認するために、fileNのそれぞれに対して1列が出力行の前に追加されます。-+" "

A - character in the column N means that the line appears in fileN but it does not appear in the result. A + character in the column N means that the line appears in the result, and fileN does not have that line (in other words, the line was added, from the point of view of that parent).-列Nの文字は行がfileNに表示されますが、それは結果に表示されないことを意味します。+列Nの文字は行が結果に表示されていることを意味し、fileNは、その行(つまり、行はその親の視点から、追加されました)がありません。

In the above example output, the function signature was changed from both files (hence two - removals from both file1 and file2, plus ++ to mean one line that was added does not appear in either file1 or file2). Also eight other lines are the same from file1 but do not appear in file2 (hence prefixed with +).上記の出力例では、関数シグネチャが両方のファイルから変更されました(したがって-、file1とfile2の両方から2つの削除が行われ、加え++て1行がfile1とfile2のどちらにも表示されません)。他の8行もfile1と同じですが、file2には現れません(したがって接頭辞は接頭辞となります+)。

When shown by git diff-tree -c, it compares the parents of a merge commit with the merge result (i.e. file1..fileN are the parents). When shown by git diff-files -c, it compares the two unresolved merge parents with the working tree file (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka "their version").で示されるときgit diff-tree -c、マージコミットの親とマージ結果を比較します(つまり、file1..fileNが親です)。で示されるときgit diff-files -c、それは2つの未解決のマージ親をワーキングツリーファイルと比較します(すなわち、file1はステージ2、別名「our version」、file2はステージ3、別名「彼らのバージョン」です)。

EXAMPLES

git log --no-merges

Show the whole commit history, but skip any mergesコミット履歴全体を表示しますが、マージはスキップします

git log v2.6.12.. include/scsi drivers/scsi

Show all commits since version v2.6.12 that changed any file in the include/scsi or drivers/scsi subdirectoriesまたはサブディレクトリ内のファイルを変更したバージョンv2.6.12以降のすべてのコミットを表示include/scsidrivers/scsi

git log --since="2 weeks ago" -- gitk

Show the changes during the last two weeks to the file gitk. The -- is necessary to avoid confusion with the branch named gitk過去2週間のファイルgitkに対する変更を表示します。--混同を避ける必要があるブランチの名前gitk

git log --name-status release..test

Show the commits that are in the "test" branch but not yet in the "release" branch, along with the list of paths each commit modifies."test"ブランチにあるがまだ "release"ブランチにはないコミットを、各コミットが変更するパスのリストと共に表示します。

git log --follow builtin/rev-list.c

Shows the commits that changed builtin/rev-list.c, including those commits that occurred before the file was given its present name.builtin/rev-list.cファイルに現在の名前が付けられる前に発生したコミットも含めて、変更されたコミットを表示します。

git log --branches --not --remotes=origin

Shows all commits that are in any of local branches but not in any of remote-tracking branches for origin (what you have that origin doesn’t).ローカルブランチのいずれかにあるが、オリジンのリモートトラッキングブランチのいずれにもないコミットをすべて表示します(そのオリジンにはないものです)。

git log master --not --remotes=*/master

Shows all commits that are in local master but not in any remote repository master branches.ローカルマスターにあるが、どのリモートリポジトリマスターブランチにもないすべてのコミットを表示します。

git log -p -m --first-parent

Shows the history including change diffs, but only from the “main branch” perspective, skipping commits that come from merged branches, and showing full diffs of changes introduced by the merges. This makes sense only when following a strict policy of merging all topic branches when staying on a single integration branch.変更の差分を含む履歴を表示しますが、「メインブランチ」の観点からのみマージされたブランチからのコミットをスキップし、マージによって導入された変更の完全な差分を表示します。これは、単一の統合ブランチに留まるときにすべてのトピックブランチをマージするという厳密なポリシーに従う場合にのみ意味があります。

git log -L '/int main/',/^}/:main.c

Shows how the function main() in the file main.c evolved over time.main()ファイル内の関数がmain.c時間の経過とともにどのように進化したかを示します。

git log -3

Limits the number of commits to show to 3.表示するコミットの数を3に制限します。

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を強制するために行われたときにコミットログメッセージを再コーディングしないことを意図的に選択したことに注意してください。

CONFIGURATION設定

See git-config[1] for core variables and git-diff[1] for settings related to diff generation.コア変数についてはgit-config [1]を、差分生成に関する設定についてはgit-diff [1]を参照してください。

format.pretty

Default for the --format option. (See Pretty Formats above.) Defaults to medium.--formatオプションのデフォルトです。(上記のプリティフォーマットを参照してください。)デフォルトはmediumです。

i18n.logOutputEncoding

Encoding to use when displaying logs. (See Discussion above.) Defaults to the value of i18n.commitEncoding if set, and UTF-8 otherwise.ログを表示するときに使用するエンコーディング。(参照議論を上記。)の値にデフォルトi18n.commitEncoding設定されている場合、及びUTF-8さもなければ。

log.date

Default format for human-readable dates. (Compare the --date option.) Defaults to "default", which means to write dates like Sat May 8 19:35:34 2010 -0500.人間が読める日付のデフォルトフォーマット。(--dateオプションを比較してください。)デフォルトは "default"です。これは、のように日付を書くことを意味しますSat May 8 19:35:34 2010 -0500

If the format is set to "auto:foo" and the pager is in use, format "foo" will be the used for the date format. Otherwise "default" will be used.フォーマットが "auto:foo"に設定されていてポケットベルが使用中の場合、フォーマット "foo"が日付フォーマットに使用されます。そうでなければ "default"が使われます。

log.follow

If true, git log will act as if the --follow option was used when a single <path> is given. This has the same limitations as --follow, i.e. it cannot be used to follow multiple files and does not work well on non-linear history.ifがtrue、単一の<path>が与えられたときにオプションが使用さgit logれたかのように動作し--followます。これには同じ制限--followがあります。つまり、複数のファイルを追跡するために使用することはできず、非線形履歴ではうまく機能しません。

log.showRoot

If false, git log and related commands will not treat the initial commit as a big creation event. Any root commits in git log -p output would be shown without a diff attached. The default is true.if falsegit logおよび関連コマンドは、最初のコミットを大きな作成イベントとして扱いません。git log -p出力中のどのルートコミットも差分を付けずに表示されます。デフォルトはtrueです。

log.showSignature

If true, git log and related commands will act as if the --show-signature option was passed to them.if truegit logおよび関連コマンドは、--show-signatureオプションが渡された場合と同じように機能します。

mailmap.* メールマップ

See git-shortlog[1].git-shortlog [1]を参照してください。

notes.displayRef

Which refs, in addition to the default set by core.notesRef or GIT_NOTES_REF, to read notes from when showing commit messages with the log family of commands. See git-notes[1].core.notesRefまたはGIT_NOTES_REFで設定されたデフォルトに加えて、logコマンドファミリーでコミットメッセージを表示したときにメモを読むことを意味します。git-notes [1]を参照してください。

May be an unabbreviated ref name or a glob and may be specified multiple times. A warning will be issued for refs that do not exist, but a glob that does not match any refs is silently ignored.省略されていない参照名またはグロブにすることができ、複数回指定することができます。存在しない参照に対しては警告が発行されますが、どの参照にも一致しないglobは暗黙のうちに無視されます。

This setting can be disabled by the --no-notes option, overridden by the GIT_NOTES_DISPLAY_REF environment variable, and overridden by the --notes=<ref> option.この設定は--no-notesオプションで無効にしたり、GIT_NOTES_DISPLAY_REF環境変数で上書きしたり、--notes=<ref>オプションで上書きしたりできます。

GIT

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

関連記事

スポンサーリンク

Linuxで接続されているUSBのバージョンを確認する方法

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

上に戻る