我想在git log输出中看到所有的隐藏。有人知道有没有办法做到这一点吗?编辑:我想查看日志中的所有提交-- * 包括 * stash提交。我尝试了以下命令:
git log
git log --date-order --all
字符串但是它只返回最上面的stash,我也希望看到代表其他stash的提交。
g9icjywg1#
你可以用git stash list来显示你所有的存储。也许你可以写一个脚本来同时显示git stash list和git log,并使用它的别名。
git stash list
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上测试
git reflog show --format="%h" stash
git log --date-order --all $(git reflog show --format="%h" stash)
git log --oneline --graph --decorate --all $(git reflog show --format="%h" stash)
tp5buhyn3#
不知道你的意思。stash是一个分支,你可以用git log -g stash列出所有的stash。
git log -g stash
lsmd5eda4#
另一种简单的方法是git reflog show stash
git reflog show stash
rggaifut5#
对于git版本2.2.3或更高版本,您可以简单地使用git log的--reflog选项。
--reflog
git log --graph --oneline --all --reflog
字符串此外,it also shows dangling commits。
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?的
wyyhbhjk7#
完整命令:第一个月在哪里的藏匿头列表:git stash list --format="%H"个
git stash list --format="%H"
mspsb9vt8#
如果您能够负担得起图形化GUI,请查看gitk。它以一种视觉上不吸引人但非常紧凑和有用的形式向你展示分支,标签,远程分支隐藏等。它通常与“git”包一起沿着在你的包管理器中,如果你也有“tk”(它使用的GUI工具包),它也可以工作。
gitk
8条答案
按热度按时间g9icjywg1#
你可以用
git stash list
来显示你所有的存储。也许你可以写一个脚本来同时显示git stash list
和git log
,并使用它的别名。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上测试
tp5buhyn3#
不知道你的意思。stash是一个分支,你可以用
git log -g stash
列出所有的stash。lsmd5eda4#
另一种简单的方法是
git reflog show stash
rggaifut5#
对于git版本2.2.3或更高版本,您可以简单地使用
git log
的--reflog
选项。字符串
此外,it also shows dangling commits。
tzdcorbm6#
要获得包含所有内容的树图:所有分支,所有隐藏在您的指尖...
1.设置git别名:
字符串
2.使用别名:
型
3.甜蜜结果:
请注意,你可以看到所有的stash,而不仅仅是给定提交上的最新stash(用箭头表示)。
的数据
参考文献:
How to create a Git alias with nested commands with parameters?的
wyyhbhjk7#
完整命令:
第一个月
在哪里的藏匿头列表:
git stash list --format="%H"
个mspsb9vt8#
如果您能够负担得起图形化GUI,请查看
gitk
。它以一种视觉上不吸引人但非常紧凑和有用的形式向你展示分支,标签,远程分支隐藏等。它通常与“git”包一起沿着在你的包管理器中,如果你也有“tk”(它使用的GUI工具包),它也可以工作。