我能否以合理的顺序让git打印x.y.z样式标签名称? [英] Can I make git print x.y.z style tag names in a sensible order?
本文介绍了我能否以合理的顺序让git打印x.y.z样式标签名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
考虑这个版本号列表:
0.3.0
0.3.1
.. 。
0.3.8
0.3.9
0.3.10
0.3.11
git tag
会按以下顺序打印它们:
0.3.0
0.3.1
0.3.10
0.3.11
0.3.2
...
我有办法让 git tag
按'数字'顺序输出而不是按字母顺序?或者一个解决方法 - 也许是一个程序,我可以通过输出来定制它们的方式?解决方案
更简单的解决方案:
serv〜:echo -e1.1.1\\\
1.3.2\\\
1.1.10\\\
1.1.2| sort -V
1.1.1
1.1.2
1.1.10
1.3.2
这里使用的 sort
选项的细分:
Consider this list of version numbers:
0.3.0
0.3.1
...
0.3.8
0.3.9
0.3.10
0.3.11
git tag
would print them in the following order:
0.3.0
0.3.1
0.3.10
0.3.11
0.3.2
...
I there any way to make git tag
print them in 'numeric' order as opposed to alphabetical order? Or a workaround - perhaps a program I can pipe the output through to order them how I want?
解决方案
Easier solution:
serv ~: echo -e "1.1.1\n1.3.2\n1.1.10\n1.1.2" | sort -V
1.1.1
1.1.2
1.1.10
1.3.2
Breakdown of the sort
options being used here:
- -V sort by version
这篇关于我能否以合理的顺序让git打印x.y.z样式标签名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文