git 如何列出自某个提交以来的提交?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7693249/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to list commits since certain commit?
提问by ehftwelve
Is there anyway to get a list of commits from a given commit number to HEAD?
无论如何要从给定的提交编号获取提交列表到 HEAD?
I know this is possible by the commit date, but I need it by the commit number and I can't seem to find any documentation, or even if this is possible.
我知道这在提交日期之前是可能的,但我需要提交编号,而且我似乎找不到任何文档,或者即使这是可能的。
回答by manojlds
git rev-list <since_hash>..HEAD
or to include the commit:
或包括提交:
git rev-list <since_hash>^..HEAD
You can use git log
instead of git rev-list
as well to get additional details.
您也可以使用git log
代替git rev-list
来获取其他详细信息。
回答by Adam Dymitruk
git log <hash>..
Is the least amount of typing. Omitting "HEAD" assumes that's what you meant. Rev-list would work too.
是最少的打字量。省略“HEAD”假定这就是您的意思。Rev-list 也可以。
回答by Matthieu
You can run the following git command from the shell:
您可以从 shell 运行以下 git 命令:
git log --pretty=oneline commit-id...HEAD
回答by hammar
Assuming that by "commit number", you mean commit hash:
假设“提交编号”是指提交哈希:
git log <commit-hash>..HEAD
回答by Matthew Hinea
If anyone here is trying to find out how to LESS through the output of git log
starting at a certain commit, paginating backward, it's as simple as git log <hash>
.
如果这里有人试图找出如何通过git log
从某个提交开始向后分页的输出来 LESS ,那么它就像git log <hash>
.