如何列出在两个分支之间更改的文件夹中的文件?

How can I list the files in a folder that changed between two branches?

例如,我有一个名为 myfolder 的文件夹;如何列出 myfolder 中在两个分支(例如 branchAbranchB 之间更改的文件?

我建议通读

git help diff

您要查找的特定命令是:

git diff --name-only $branch1 $branch2 -- $path_to_folder_or_file

您可以比较两个提交之间的差异,如下所示:

git log

您将获得一份关于您的回购中所有提交的列表: 例子..

commit 8781017d5d7e507511fd1631b9263620671407ea
Author: DavidANegrete <davidnegrete@g.harvard.edu>
Date:   Wed Oct 7 14:18:41 2015 -0600

    complete the method to seach

commit 10eab44a41a4f4141b7cce80ffcaa7a676297bcb
Author: DavidANegrete <davidnegrete@g.harvard.edu>
Date:   Sat Oct 3 18:57:20 2015 -0600

现在进行比较:

get diff 10eab44a41a4f4141b7cce80ffcaa7a676297bcb 8781017d5d7e507511fd1631b9263620671407ea