[英]Get first line by git log with a single command on windows
似乎是一个非常简单的问题,已经使我发疯。 尝试通过以下命令从提交列表中获取第一行:
E:\\ Repos \\ reports> git log --oneline --reverse origin / master..feature / a123
获取以下输出
d8c38ac Dummy change to invoke deploy
aaca9eb (HEAD -> feature/a123, origin/feature/a123) Add transation isolation
然后尝试做
E:\\ Repos \\ reports> git log --oneline --reverse origin / master..feature / a123 -n 1
不管我是否使用--reverse
,我总是得到aaca9eb
commit
是的,这很令人沮丧,因为按数字( -n
)限制提交的次数发生在 --reverse
之前 。
尽管您可以将其通过管道传递给尾巴:
git log --oneline --reverse origin/master..feature/a123 | tail -1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.