admin管理员组文章数量:1127960
Since I have multiple colleagues in my team pushing out considerable amount of branches, whenever I want to disentangle my own branches I'd like to get a clear overview of only those. In summary I want to use git log --graph --oneline --decorate
but only on branches:
- that are my own local branches
- that are specified as the upstream of any of my own local branches
Is there a git command that can realize this?
Since I have multiple colleagues in my team pushing out considerable amount of branches, whenever I want to disentangle my own branches I'd like to get a clear overview of only those. In summary I want to use git log --graph --oneline --decorate
but only on branches:
- that are my own local branches
- that are specified as the upstream of any of my own local branches
Is there a git command that can realize this?
Share Improve this question edited Jan 8 at 17:13 Guildenstern 3,7252 gold badges28 silver badges52 bronze badges asked Jan 8 at 16:06 hasdrubalhasdrubal 1,13815 silver badges34 bronze badges 3 |1 Answer
Reset to default 4First, you can have all local branches with --branches
.
Then, for the remote branches your local branches are tracking, you'll have to do a bit of mapping through git for-each-ref
for instance:
git log --graph --branches --ignore-missing $(git for-each-ref --format="%(upstream:short)" refs/heads | sort -u)
(Thanks to Guildenstern for the --ignore-missing
suggestion to avoid having to chase stale remote references beforehand.)
本文标签: git loggit log graph smart filter on branchesStack Overflow
版权声明:本文标题:git log - git log graph smart filter on branches - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736704159a1948582.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
--branches
to yourlog
command. – Romain Valeri Commented Jan 8 at 16:13git log --graph
, won't you only see your own stuff? – Daniel Walker Commented Jan 8 at 16:15