我在做:
git log --pretty=format:"%h - %an, %ar : %s" -10
以下哪项输出:
sha1 <pretty format>
sha1 <pretty format>我希望每一行都以递增的数字开头。例如。
1. sha1 <pretty format>
2. sha1 <pretty format>这可能吗?
发布于 2019-10-17 21:26:12
git log --pretty=format:"%h - %an, %ar : %s" -10 | cat -n
或者:
git log --pretty=format:"%h - %an, %ar : %s" -10 | nl
或者如果你真的想要.
git log --pretty=format:"%h - %an, %ar : %s" -10 | nl -s'. '
(需要注意的是,nl填充了数字。)
(当然,还有一百万种不同的sed和awk解决方案。)
https://stackoverflow.com/questions/58433779
复制相似问题