git reflog 管道传输时丢失数据

Nig*_*der 0 git bash grep git-tag

git reflog
Run Code Online (Sandbox Code Playgroud)

输出日志看起来像这样

8b388bc (HEAD -> master) HEAD@{0}: commit (amend): tempppp22222
7c33c70 (tag: v2.0) HEAD@{1}: commit: tempppp
76702b2 (origin/master, origin/HEAD) HEAD@{2}: reset: moving to HEAD^
fc1ea9d HEAD@{3}: commit (amend): temp2
0bc8223 (tag: v1.0) HEAD@{4}: reset: moving to 0bc8223
Run Code Online (Sandbox Code Playgroud)

但当我尝试时

git reflog | grep "HEAD@{1}"
Run Code Online (Sandbox Code Playgroud)

输出看起来像这样

7c33c70 HEAD@{1}: commit: tempppp
Run Code Online (Sandbox Code Playgroud)

有人可以告诉我为什么标签名称丢失吗?

jer*_*ile 5

git reflog --help:

选项
show
git reflog show 的选项 show 接受 git log 接受的任何选项。

git log --help:

选项
--no-decorate, --decorate[=short|full|auto|no]
打印出显示的任何提交的引用名称。如果指定了short,则不会打印引用名称前缀refs/heads/、refs/tags/和refs/remotes/。如果指定了 full,则将打印完整的引用名称(包括前缀)。如果指定了 auto,则如果输出将发送至终端,则将显示引用名称,就像给出了 Short 一样,否则不显示引用名称。选项 --decorate 是 --decorate=short 的缩写。如果已配置,则默认为 log.decorate 的配置值,否则为 auto。

TL;DR:使用--decorate