For git log
, we have git log --reverse
to show logs in the reverse order, but I tried git reflog --reverse
, it returns fatal: options '--reverse' and '--walk-reflogs' cannot be used together
. Is there any way to show git reflog
in reverse order?
Asked
Active
Viewed 45 times
0

Wenfang Du
- 8,804
- 9
- 59
- 90
-
I was about to suggest `| tail -r` but the Git for Windows terminal seems not to recognize the `-r` option. (but `tac` works, so see [knittl](https://stackoverflow.com/a/76578276/1057485)'s answer for people using Git for Windows) – Romain Valeri Jun 29 '23 at 07:17
1 Answers
1
Most systems have tac
available. Since the reflog is a flat list (and not a graph), you could simply reverse the list output:
git reflog | tac

knittl
- 246,190
- 53
- 318
- 364
-
-
2@WenfangDu : https://unix.stackexchange.com/questions/114041/how-can-i-get-the-tac-command-on-os-x -- looks like on MacOS `tail -r` does the same thing – LeGEC Jun 29 '23 at 07:20