cYr*_*rus 74 git git-stash git-log
我有一个Git别名扩展为:
git log --graph --oneline --all --decorate
Run Code Online (Sandbox Code Playgroud)
根据man git log
有几个可疑的选择:--not
和--branches
; 但我不能让它正常工作.
我应该如何编辑以隐藏藏匿处?
仅供参考:根据已接受的问题和评论,我的.gitconfig
别名现在看起来像这样:
[alias]
l = log --branches --remotes --tags --graph --oneline --decorate --notes HEAD
Run Code Online (Sandbox Code Playgroud)
And*_*all 106
而不是做--all
,然后尝试过滤掉藏匿处,不要首先包括它们:
git log --branches --remotes --tags --graph --oneline --decorate
Run Code Online (Sandbox Code Playgroud)
尝试过滤掉它们后出现的主要问题是,如果存储是该分支上的最新提交(因为即使它不是head
分支的,它仍然是它的最新后代),它实际上可以过滤掉来自日志的整个分支,这不是你想要的.
小智 6
我的别名:
[alias]
l = log --oneline --decorate --graph --exclude=refs/stash
Run Code Online (Sandbox Code Playgroud)
在这种情况下,您将能够使用这些表单而无需显示隐藏信息:
git l
对于当前分支git l feature234
对于特定的分支git l --all
整体历史从手册中:
--exclude = <全局模式>
不要包含与下一个--all,-branches,-tags,-remotes或--glob会考虑的匹配的引用。
请注意,Andrew 的答案不适用于隐藏StGit 1.)分支<branch>.stgit
(来自 StGit 版本 0.15),否则会导致输出乱七八糟,使其无法使用。
目前我使用以下解决方案:
$ git log --graph --oneline --decorate \
$(git for-each-ref --format="%(refname)" refs/heads/ refs/remotes/ |
grep -v "\.stgit$")
Run Code Online (Sandbox Code Playgroud)
1.) StGit(“ Stacked Git ”)为 Git 提供类似于 Quilt/mq 的功能(即将补丁推送到堆栈或从堆栈中弹出补丁)。
归档时间: |
|
查看次数: |
19449 次 |
最近记录: |