我知道这里有非常相似的问题,但他们没有解决我的问题。 可能有些地方我不太了解。
这是 fitnesse ( https://github.com/unclebob/fitnesse/ ) 提交历史的一部分:
* | | | | | | | | | | | | | | | fa86be8 Avoid possible issue when using CachingPage under heavy memory load.
|/ / / / / / / / / / / / / / /
* | | | | | | | | | | | | | | 7b4a07a Merge pull request #256 from barredijkstra/fitnesse_issue_250
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | | | | | ecf5891 Fixed test checking for OS specific exception message.
| * | | | | | | | | | | | | | | 082236e Added rendering of cause exceptions. Fix for unclebob/fitnesse#250
* | | | | | | | | | | | | | | | a92b37f Merge pull request #243 from amolenaar/fix/243-hash-table-rendering
我想要 2 个提交哈希值之间的提交列表。在这种特殊情况下,我希望在 ecf5891
和 7b4a07a
之间进行提交,我希望结果为:
ecf5891
7b4a07a
到目前为止,我一直在使用 git rev-list commit_hash_from_here^..commit_hash_up_to_here
并且它在线性历史上运行良好。但是,在这种情况下,我得到了更多的提交。
我试过了,效果和预期的一样:
git log --since='<date ecf5891>' --until='<date 7b4a07a>'
(我手动搜索了这 2 个日期)。
一个可能的解决方案是获取 2 个日期并执行此操作,但我认为应该有更好的方法。
编辑:
7b4a07a
parent 是 ecf5891
和 a92b37f
。到目前为止,如果我想从 ecf5891
到 7b4a07a
,解决方案工作正常,但如果我想从 a92b37f
到 7b4a07a
我想得到:
7b4a07a
ecf5891
082236e
a92b37f
但我没有得到 a92b37f
最佳答案
我认为您正在寻找 --ancestry-path ,在你的情况下:
git rev-list --ancestry-path 7b4a07a..ecf5891
关于git - 列出 git 中 2 个提交哈希之间的提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18679870/