1
ディレクトリ名の変更を含むリポジトリ内のコミットを探したい。それは私が近くなりますが、私は私がちょうどファイルではなくディレクトリを指定できるようになるもの、また動きを見ることができないよう ディレクトリ名の変更や移動であったリポジトリ履歴でgit commitを見つける
git log ...
私はthe Pro Git book on git-scm.comで探していると
が見えます。ディレクトリ名の変更を含むリポジトリ内のコミットを探したい。それは私が近くなりますが、私は私がちょうどファイルではなくディレクトリを指定できるようになるもの、また動きを見ることができないよう ディレクトリ名の変更や移動であったリポジトリ履歴でgit commitを見つける
git log ...
私はthe Pro Git book on git-scm.comで探していると
が見えます。git
ディレクトリを管理していません。それはファイルを管理するだけです。 「ディレクトリ名変更」の記録はありません。ディレクトリにあったすべてのファイルの名前が変更されます。
次の例を考えます。私は、単一のディレクトリfoo
含むリポジトリで始まる:
git init .
mkdir foo
touch foo/file{1,2,3}
git commit -m 'initial commit'
を今私はそれを名前を変更:今すぐ
git mv foo bar
git commit -m 'renamed foo -> bar'
git show
は私を示しています
$ git show
commit 0429048856377cda39eb475248e142e1bfa4323b
Author: Lars Kellogg-Stedman <[email protected]>
Date: Mon Oct 30 08:52:24 2017 -0400
renamed foo -> bar
diff --git a/foo/file1 b/bar/file1
similarity index 100%
rename from foo/file1
rename to bar/file1
diff --git a/foo/file2 b/bar/file2
similarity index 100%
rename from foo/file2
rename to bar/file2
diff --git a/foo/file3 b/bar/file3
similarity index 100%
rename from foo/file3
rename to bar/file3
あなたはgit log --summary
を使用して同様の情報を得ることができます:
$ git log --summary
commit 0429048856377cda39eb475248e142e1bfa4323b
Author: Lars Kellogg-Stedman <[email protected]>
Date: Mon Oct 30 08:52:24 2017 -0400
renamed foo -> bar
rename {foo => bar}/file1 (100%)
rename {foo => bar}/file2 (100%)
rename {foo => bar}/file3 (100%)
それは私の半分の方法をそこに得ます。 'git log'と同じ方法で' rename '行をdiffから出力するように 'git log'に指示する方法はありますか? – Adam
'git log --summary'を見てみましょうか? – larsks
はい、私は 'rename'や '=>'でgrepすることができると思います。私は目でファイルとディレクトリを区別できるはずです。 – Adam