show

NAME

git-show - Show various types of objectsgit-show - さまざまな種類のオブジェクトを表示する

SYNOPSIS概要

git show [<options>] [<object>…​]

DESCRIPTION説明

Shows one or more objects (blobs, trees, tags and commits).1つ以上のオブジェクト(BLOB、ツリー、タグ、コミット)を表示します。

For commits it shows the log message and textual diff. It also presents the merge commit in a special format as produced by git diff-tree --cc.コミットの場合はログメッセージとテキストの差分が表示されます。また、git diff-tree --ccによって生成されたマージコミットを特別な形式で提示します。

For tags, it shows the tag message and the referenced objects.タグの場合は、タグメッセージと参照先オブジェクトが表示されます。

For trees, it shows the names (equivalent to git ls-tree with --name-only).木の場合は、名前が表示されます(--name-onlyを指定したgit ls-treeと同等)。

For plain blobs, it shows the plain contents.プレーンBLOBの場合は、プレーンコンテンツを表示します。

The command takes options applicable to the git diff-tree command to control how the changes the commit introduces are shown.このコマンドは、git diff-treeコマンドに適用可能なオプションを取り、コミットによる変更の表示方法を制御します。

This manual page describes only the most frequently used options.このマニュアルページは最も頻繁に使われるオプションだけを説明します。

OPTIONSオプション

<object>…​ <オブジェクト>…

The names of objects to show (defaults to HEAD). For a more complete list of ways to spell object names, see "SPECIFYING REVISIONS" section in gitrevisions[7].表示するオブジェクトの名前(デフォルトはHEAD)。オブジェクト名をつづる方法のより完全なリストについては、gitrevisions [7]の "リビジョンの指定"セクションを見てください。

--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、出力を表示します。

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 show v1.0.0

Shows the tag v1.0.0, along with the object the tags points at.v1.0.0タグが指すオブジェクトと共に、タグを表示します。

git show v1.0.0^{tree}

Shows the tree pointed to by the tag v1.0.0.タグが指すツリーを表示しますv1.0.0

git show -s --format=%s v1.0.0^{commit}

Shows the subject of the commit pointed to by the tag v1.0.0.タグが指すコミットの件名を表示しv1.0.0ます。

git show next~10:Documentation/README

Shows the contents of the file Documentation/README as they were current in the 10th last commit of the branch next.Documentation/READMEブランチの最後の10回目のコミットで現在のファイルの内容を表示しますnext

git show master:Makefile master:t/Makefile

Concatenates the contents of said Makefiles in the head of the branch master.ブランチの先頭にある上記Makefileの内容を連結しmasterます。

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

GIT

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

関連記事

スポンサーリンク

各メーカーのルーターのID・パスワードの一覧 K

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

上に戻る