git 重新记录管道时丢失的数据
git reflog missing data when piping
有
git reflog
输出日志如下所示
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
但是当我尝试
git reflog | grep "HEAD@{1}"
输出看起来像这样
7c33c70 HEAD@{1}: commit: tempppp
谁能告诉我为什么缺少标签名称?
git reflog --help
:
OPTIONS
Options for show
git reflog show accepts any of the options accepted by git log.
git log --help
:
OPTIONS
--no-decorate, --decorate[=short|full|auto|no]
Print out the ref names of any commits that are shown. If short is specified, the ref name prefixes refs/heads/, refs/tags/
and refs/remotes/ will not be printed. If full is specified, the full ref name (including prefix) will be printed. If auto is
specified, then if the output is going to a terminal, the ref names are shown as if short were given, otherwise no ref names
are shown. The default option is short.
TL;DR: 使用 --decorate
有
git reflog
输出日志如下所示
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
但是当我尝试
git reflog | grep "HEAD@{1}"
输出看起来像这样
7c33c70 HEAD@{1}: commit: tempppp
谁能告诉我为什么缺少标签名称?
git reflog --help
:
OPTIONS
Options for show
git reflog show accepts any of the options accepted by git log.
git log --help
:
OPTIONS
--no-decorate, --decorate[=short|full|auto|no]
Print out the ref names of any commits that are shown. If short is specified, the ref name prefixes refs/heads/, refs/tags/ and refs/remotes/ will not be printed. If full is specified, the full ref name (including prefix) will be printed. If auto is specified, then if the output is going to a terminal, the ref names are shown as if short were given, otherwise no ref names are shown. The default option is short.
TL;DR: 使用 --decorate