简体   繁体   中英

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?

note: I think your question needs more details.

can you explain what you intend to do with that list in your 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.

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 --no-renames --name-only --diff-filter=A \
     $(git rev-list -1 --before="<date>" HEAD) HEAD

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM