如何查找自提交以来未更改的文件? [英] How to find which files have not changed since commit?
本文介绍了如何查找自提交以来未更改的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在git中,如何找出自提交以来目录中的哪些文件没有更改?
In git, how can one find out which files in directory have NOT changed since some commit?
推荐答案
IMO生成列表的简单得多的方法是以下命令链:
IMO a far easier way to generate your list would be the following command chain:
git ls-files --full-name | grep -v "$(git diff --name-only <REF>)"
其中<REF>
是提交的哈希值,您希望从此提交未更改的文件.
Where <REF>
is the hash of the commit from which you want the unchanged files since.
git ls-files
列出所有版本文件,然后grep自指定提交以来不在更改文件列表中的所有文件.
git ls-files
list, as you could expect, all versioned files and then you grep all files which aren't in the list of changed files since the specified commit.
这篇关于如何查找自提交以来未更改的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文