簡體   English   中英

git 重新記錄管道時丟失的數據

[英]git reflog missing data when piping

git reflog

output 日志看起來像這樣

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}"

output 看起來像這樣

7c33c70 HEAD@{1}: commit: tempppp

有人能告訴我為什么缺少標簽名稱嗎?

git reflog --help :

選項
顯示選項
git reflog 顯示接受 git 日志接受的任何選項。

git log --help ——幫助:

選項
--no-decorate, --decorate[=short|full|auto|no]
打印出顯示的任何提交的引用名稱。 如果指定了 short,則不會打印 ref 名稱前綴 refs/heads/、refs/tags/ 和 refs/remotes/。 如果指定了 full,將打印完整的 ref 名稱(包括前綴)。 如果指定了 auto,那么如果 output 將要發送到終端,則顯示 ref 名稱,就好像給出了 short 一樣,否則不顯示任何 ref 名稱。 選項 --decorate 是 --decorate=short 的縮寫。 如果已配置,則默認為 log.decorate 的配置值,否則為 auto。

TL;DR:使用--decorate

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM