问题
I'd like to find out all the files that have been modified on the master branch (or any one branch for that matter) between two dates.
I understand, from this post (How to list the file names only that changed between two commits?) that I can use
git diff --name-only SHA1 SHA2
but I don't know, a priori, what the SHA's are between today and yesterday. Especially when there can be more than one commit on a day.
To be more precise, I would like to know the list of files changed on the master git repo between Today at 12:01 AM and yesterday at 12:01 AM.
Is this possible? I used to be able to do this in CVS with cvs diff -D "1 days ago"
.
回答1:
git has a facility for using the reflog to get the position a name was at an arbitrary amount of time ago.
git diff --name-only master@{1 day ago} master
This will give you the difference between where master
was exactly one day prior to now, and where master is now.
来源:https://stackoverflow.com/questions/14863735/git-how-can-i-list-all-files-changed-on-the-master-branch-between-two-times