Git在日志中显示所有分支(但不包含stst) [英] Git show all branches (but not stashes) in log

查看:174
本文介绍了Git在日志中显示所有分支(但不包含stst)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个扩展到的Git别名:

  git log --graph --oneline --all --decorate 

根据 man git log ,有一个几个可疑选项: - 不是 - 分支;但我无法使它正常工作。



我应该如何编辑以隐藏存储?






供参考:根据接受的问题评论我的 .gitconfig 别名现在看起来像这样:

  [别名] 
l = log - 分支--remotes --tags --graph --oneline --decorate --notes HEAD


解决方案 然后试图过滤掉包装, p>

  git log --branches --remotes --tags --graph --oneline --decorate 

之后尝试过滤出现的主要问题是,如果存储是该麸皮上的最新提交ch(因为即使它不是分支的 head ,它仍然是它最近的后代),它实际上可以从日志中过滤出整个分支,你想要什么。


I have a Git alias that expands to:

git log --graph --oneline --all --decorate

According to man git log there are a couple of suspicious options: --not and --branches; but I can't make it work properly.

How should I edit that to hide the stashes?


FYI: as per the accepted question and comment my .gitconfig alias now looks like this:

[alias]
    l = log --branches --remotes --tags --graph --oneline --decorate --notes HEAD

解决方案

Instead of doing --all and then trying to filter out the stashes, don't ever include them in the first place:

git log --branches --remotes --tags --graph --oneline --decorate

The main problem that arises from trying to filter them out afterwards is that if the stash is the latest commit on that branch (because even though it's not the head of the branch, it's still the most recent descendant of it), it can actually filter out the entire branch from the log, which isn't what you want.

这篇关于Git在日志中显示所有分支(但不包含stst)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆