Git - 如何列出两次之间在主分支上更改的所有文件? [英] Git - How can I list all files changed on the master branch between two times?
问题描述
我想知道在两个日期之间在主分支(或任何一个分支)上修改过的所有文件。理解,从这篇文章(如何列出仅在两个提交?),我可以使用
git diff - 仅限名称SHA1 SHA2
但我不知道,先验的,今天和昨天之间的SHA。特别是当一天可能有多个提交时。
更确切地说,我想知道在今天之间master git repo上更改的文件列表在上午12:01和昨天上午12:01。
这可能吗?我曾经可以在CVS中使用 cvs diff -D1天前
。
git有一个使用reflog来获取名称在任意时间前的位置的工具。
git diff - 仅限名称master @ {1天前} master
这会让你知道 master
是现在的前一天,还是现在的主人。
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"
.
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.
这篇关于Git - 如何列出两次之间在主分支上更改的所有文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!