[英]How do I see all files added to a repo since a certain date in git?
I am trying to change a make file for a different platform in our project, and it would be really handy to be able to see all files added since a certain date.我正在尝试在我们的项目中为不同的平台更改生成文件,并且能够查看自某个日期以来添加的所有文件真的很方便。 The main problem is that there are a huge number of files, and remembering which files still need to be added can take a lot of tries.
主要问题是文件数量巨大,记住哪些文件仍需要添加可能需要多次尝试。 Is there a way to query this file list in git or other command line tools?
有没有办法在 git 或其他命令行工具中查询这个文件列表?
note: I think your question needs more details.注意:我认为您的问题需要更多详细信息。
can you explain what you intend to do with that list in your Makefile ?您能解释一下您打算在 Makefile 中使用该列表做什么吗?
One way to get that list is to run git diff
between the current commit, and a commit reported to be created at that past date.获取该列表的一种方法是在当前提交和报告在该过去日期创建的提交之间运行
git diff
。
To get that commit in the past, you can try :要在过去获得该提交,您可以尝试:
git rev-list -1 --before="<date>"
To use git diff to only list file names of files that were added since that commit :要使用 git diff 仅列出自提交以来添加的文件的文件名:
git diff --no-renames --name-only --diff-filter=A \
$(git rev-list -1 --before="<date>" HEAD) HEAD
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.