在 git log 中显示所有隐藏
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14988929/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Show all stashes in git log
提问by jbialobr
I would like to see all stashes in git log
output. Does anyone know if there is a way to do that?
我想看到git log
输出中的所有隐藏。有谁知道是否有办法做到这一点?
Edit: I want to log all commits. I use the command
编辑:我想记录所有提交。我使用命令
git log --date-order --all
But it returns only the top most stash. I would like to see commits that represent other stashes.
但它只返回最上面的藏匿处。我希望看到代表其他存储的提交。
采纳答案by SicoAnimal
I came here looking to do the same as @jbialobr, I did some more digging after reading the previous answers and came up with the below.
我来这里是想和@jbialobr 做同样的事情,在阅读了之前的答案后,我做了更多的挖掘,并提出了以下答案。
@msmt's answer gives you a log of the stashes, and you can use this to get the hashes to use in the git log.
@msmt 的回答为您提供了一个存储日志,您可以使用它来获取要在 git 日志中使用的哈希值。
git reflog show --format="%h" stash
gives you just the hashes of all stashes which can then be passed to a git log command such as
git reflog show --format="%h" stash
只为您提供所有存储的哈希值,然后可以将其传递给 git log 命令,例如
git log --date-order --all $(git reflog show --format="%h" stash)
git log --date-order --all $(git reflog show --format="%h" stash)
The full command I personally am now using is
我个人现在使用的完整命令是
git log --oneline --graph --decorate --all $(git reflog show --format="%h" stash)
git log --oneline --graph --decorate --all $(git reflog show --format="%h" stash)
Tested on git version 2.5.1 on centos
在 centos 上的 git 版本 2.5.1 上测试
回答by mgarciaisaia
You can show all your stashes with git stash list
. Maybe you can write a script to show both git stash list
and git log
and use it with an alias.
您可以使用git stash list
. 也许您可以编写一个脚本来显示这两者git stash list
,git log
并将其与别名一起使用。
回答by robinr
Not sure what you mean. stash is a branch and you can list all stashes with git log -g stash
.
不明白你的意思。stash 是一个分支,您可以使用git log -g stash
.
回答by Michael
Another easy way to do this is git reflog show stash
另一种简单的方法是 git reflog show stash
回答by Andrey Bochkov
Full command:
完整命令:
git log --oneline --graph --all $(git stash list --format="%H")
git log --oneline --graph --all $(git stash list --format="%H")
Where list of heads of stashes:
藏匿头目列表:
git stash list --format="%H"
git stash list --format="%H"
回答by VasiliNovikov
If you can afford having a graphical GUI, take a look at gitk
.
如果您负担得起图形 GUI,请查看gitk
.
It shows you branches, tags, remote branches stashes etc. In a visually not appealing, but very compact and useful form. It usually comes along with "git" package in your package manager and works if you also have "tk" (the GUI toolkit it uses).
它以一种视觉上不吸引人但非常紧凑和有用的形式向您显示分支、标签、远程分支隐藏等。它通常与包管理器中的“git”包一起提供,如果你也有“tk”(它使用的 GUI 工具包),它就可以工作。