在git log中显示所有隐藏

daolsyd0  于 11个月前  发布在  Git
关注(0)|答案(8)|浏览(119)

我想在git log输出中看到所有的隐藏。有人知道有没有办法做到这一点吗?
编辑:我想查看日志中的所有提交-- * 包括 * stash提交。我尝试了以下命令:

git log --date-order --all

字符串
但是它只返回最上面的stash,我也希望看到代表其他stash的提交。

g9icjywg

g9icjywg1#

你可以用git stash list来显示你所有的存储。也许你可以写一个脚本来同时显示git stash listgit log,并使用它的别名。

55ooxyrt

55ooxyrt2#

我来这里是想和@jbialobr做同样的事情,在阅读了之前的答案后,我做了更多的挖掘,并得出了下面的答案。
@msmt的答案会给你一个隐藏的日志,你可以用它来获取git日志中要使用的哈希值。
git reflog show --format="%h" stash只提供所有stash的哈希值,然后可以将其传递给git log命令,例如
git log --date-order --all $(git reflog show --format="%h" stash)
我个人现在使用的完整命令是
git log --oneline --graph --decorate --all $(git reflog show --format="%h" stash)
在centos上的git版本2.5.1上测试

tp5buhyn

tp5buhyn3#

不知道你的意思。stash是一个分支,你可以用git log -g stash列出所有的stash。

lsmd5eda

lsmd5eda4#

另一种简单的方法是git reflog show stash

rggaifut

rggaifut5#

对于git版本2.2.3或更高版本,您可以简单地使用git log--reflog选项。

git log --graph --oneline --all --reflog

字符串
此外,it also shows dangling commits

tzdcorbm

tzdcorbm6#

要获得包含所有内容的树图:所有分支,所有隐藏在您的指尖...

# Short and sweet: hashes and graph with all branches and stashes
git config --global alias.l \
    '!sh -c '"'"' git log --oneline --graph --all --decorate $(git stash list --format="%h") '"'"' '

# Same as above + dates and emails
git config --global alias.ll \
    '!sh -c '"'"' git log --graph --all --date=format:"'"%Y-%m-%d %H:%M"'" --pretty=format:"'"%C(yellow)%h%Creset%C(auto)%d%Creset %C(cyan)%cd%Creset %s %C(green)(%ce)%Creset"'" $(git stash list --format="%h") '"'"' '

字符串

2.使用别名

# Short and sweet: hashes and graph with all branches and stashes
git l

# Same as above + dates and emails
git ll

3.甜蜜结果

请注意,你可以看到所有的stash,而不仅仅是给定提交上的最新stash(用箭头表示)。


的数据
参考文献:
How to create a Git alias with nested commands with parameters?

wyyhbhjk

wyyhbhjk7#

完整命令:
第一个月
在哪里的藏匿头列表:
git stash list --format="%H"

mspsb9vt

mspsb9vt8#

如果您能够负担得起图形化GUI,请查看gitk
它以一种视觉上不吸引人但非常紧凑和有用的形式向你展示分支,标签,远程分支隐藏等。它通常与“git”包一起沿着在你的包管理器中,如果你也有“tk”(它使用的GUI工具包),它也可以工作。

相关问题