When I have git log print out as oneline, how do I

2019-08-28 12:11发布

I have git log aliased to this:

git log --reverse --oneline --pretty=format:'-%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'

But I want it to be reversed as well, as sometimes it's inconvenient to have the top needed to be scrolled to.

标签: git bash
2条回答
老娘就宠你
2楼-- · 2019-08-28 12:51

maybe you for some reason want reverse it more times, so the

your_command | perl -e 'reverse <>'

can help ;)

or the

your_command | tail -r

or as @evnu suggest

your_command | tac

or when want reverese each line, you can

your_command | perl -nlE 'chomp;say scalar reverse'

especially the last is good, for example:

date | perl -nlE 'chomp;say scalar reverse'

prints

3102 TSEC 32:95:91 41 yaM euT

ps: kidding only.. :)

查看更多
beautiful°
3楼-- · 2019-08-28 13:06

Take the --reverse out of the command you already have i.e.

git log --oneline --pretty=format:'-%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
查看更多
登录 后发表回答