简体   繁体   English

如何在 git 中查看自某个日期以来添加到 repo 的所有文件?

[英]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.

相关问题 如何查看 git 添加的文件? - How do I see git added files? 在某个日期之后,我如何获得* I *已提交给Git(GitHub存储库)的所有文件的列表? - How can I get a list of all files *I* have committed to Git (GitHub repo) after a certain date? 提取自某个日期以来在 repo 中更改的所有文件 - Extract all files changed in repo since a certain date Git:如何删除 git status -s 中带有“??”的文件,这些是我添加到本地存储库的文件? - Git: How do I remove files listed in git status -s with “??”, these are files I added to local repo? git-如何列出自某个日期以来未更改的所有文件? - git - How to list all files that have not been changed since a certain date? 如何使用 git 查看自初始创建以来对所有文件的更改? - How to use git to see changes to all files since their initial creation? 自从特定作者在git中创建分支以来,如何获取已更改和已添加文件的列表? - How do I get the list of changed and added files since the creation of a branch in git by a specific author? 如何从Git仓库中的所有提交中删除某些文件? - How do you remove certain files from all commits in a Git repo? git:如何在特定日期检索所有文件 - git: how to retrieve all files as of a certain date 如何为自某次提交后更改的所有文件添加注释? - How do I add comments to all files changed since a certain commit?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM