简体   繁体   English

获取按日期排序的所有提交的列表(包括悬空提交)

[英]Get a list of all commits that is ordered by date (including dangling commits)

How can I get a list of absolutely everything that can be reached that is ordered by date ? 如何获得按日期排序的绝对可以到达的所有清单? Normal commits, stashes, dropped stashes, commits from deleted branches - everything that hasn't been vacuumed yet. 正常的提交,隐藏,隐藏的隐藏,来自已删除分支的提交-尚未清理的所有内容。

I'm asking because I need to find a particular commit (or stash) and I don't remember much except the date when it must have been added. 我之所以问是因为我需要找到一个特定的提交(或存储),并且除了必须添加的日期之外,我不记得太多。 Since I never run git gc , I assume it should still be available somewhere. 由于我从未运行过git gc ,因此我认为它应该仍然可以在某处使用。

I also need the to see the timestamp for each commit, because I will have to use that to narrow down the search to only commits/stashes that are around the date I have in mind. 我还需要查看每个提交的时间戳,因为我将不得不使用该时间戳将搜索范围缩小到仅考虑我所考虑的日期的提交/缓存。

Edit: In case it is not clear it is crucial that I search dangling commits and dropped stashes in addition to the normal ones. 编辑:如果不清楚,除了正常的外,我搜索悬挂的提交和隐藏的存储至关重要。 Questions like How can I make git log order based on author's timestamp? 诸如如何根据作者的时间戳使git日志顺序化之类的问题? do not address that. 不解决这个问题。

One thing to try is simply git reflog or git reflog HEAD (which are equivalent, the first is just a shorthand for the second). 可以尝试的一件事只是git refloggit reflog HEAD (它们等效,第一个只是第二个的简写)。

The reflog tracks every commit that a particular ref points to; 引用日志跟踪特定引用指向的每个提交; HEAD is the ref that points to what you have currently checked out, so if you ever had the commit in question checked out on this machine, and it hasn't yet been gc'd, it should show up in that list. HEAD是指向您当前已签出内容的引用,因此,如果您曾经在此计算机上签出有问题的提交,并且尚未进行gc提交,它将显示在该列表中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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