私はしばしばgit status
を実行し、それらのファイルの特定のdiffを表示したいとします。だから、後:git diff <someMagic(2)>
はgit diff path/to/modified/file2
に減少するであろうように、gitコマンドでgitステータス出力のn番目の修正ファイルをdiffする
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: path/to/modified/file1
modified: path/to/modified/file1
それは、git diff
n番目の変更されたファイルに、gitの持つ可能性、またはフォールバックbashのようです。
私の主な質問は、これがgit内に存在するかどうか、またbashコマンドを使用しない場合です。
ないが、 'gitのステータス--porcelain'と'尾+ $ 1を用いた構築するのは簡単| -1 "または" sed -n -e '$ 1 {p; q;}' 'となります。 – torek