Is there a way, how to get know which of 2 commits ahead ? (if any)

I have 2 tags and I need to realize which one is ahead(I'm sure they are in same line). Is there a way how to make it done ? Edit: I mean automatically .. like to get commit1 < commit2 or other way around.


Ok, I was able to get it by combination of

git show-ref --tags | grep -e tagName1 -e tagName2

git rev-list commitOfTagName1 --count

git rev-list commitOfTagName2 --count

and comp


Rather simple — just count commits from one to the other in both directions. Example (from my real repo with real tags):

$ git rev-list v2.6.0..v2.5.0 | wc -l
0
$ git rev-list v2.5.0..v2.6.0 | wc -l
13

Now I see that tag v2.6.0 is ahead of v2.5.0 by 13 commits.

链接地址: http://www.djcxy.com/p/23164.html

上一篇: git存储库是13提交opencv:master

下一篇: 有没有办法,如何知道2个提交中的哪一个? (如果有的话)