git branch日期排序

vi ~/.gitconfig

[alias]
lb = !"for k in `git branch -a|perl -pe s/^..//`;do echo `git show --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset\" $k|head -n 1`\\\t$k;done|sort|tail"

使用:
git lb

命令解释:
git branch -a 查看远程和本地分支
sort 升序
sort -r 逆序
tail 显示尾部10个
tail -n 20 显示尾部20个
可以使用sort --help tail --help查看使用帮助

参考:
git获取分支创建时间,并且按时间先后排序
https://blog.csdn.net/only2xlr/article/details/45874827

 
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2021-12-27
  • 2021-08-29
  • 2021-11-19
猜你喜欢
  • 2021-09-13
  • 2021-05-12
  • 2022-02-16
  • 2021-12-07
  • 2021-09-09
  • 2022-12-23
  • 2021-04-20
相关资源
相似解决方案