如何以相反顺序显示Git的reflog?

huangapple go评论58阅读模式
英文:

How to show git reflog in reverse order?

问题

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?

对于 git log,我们有 git log --reverse 以倒序显示日志,但我尝试了 git reflog --reverse,它返回 fatal: options '--reverse' and '--walk-reflogs' cannot be used together。有没有办法以倒序方式显示 git reflog

英文:

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?

答案1

得分: 1

大多数系统都有tac可用。由于reflog是一个平面列表(而不是图形),您可以简单地反转列表输出:

git reflog | tac
英文:

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

huangapple
  • 本文由 发表于 2023年6月29日 13:19:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/76578238.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定