I want to log all changes on a specific set of branches to see the relationshop between them, and I found that:
git log --graph --oneline --topo-order --decorate --simplify-by-decoration `git branch --list -a origin/foo/*`
does exactly what I want (i.e. log changes on all branches that are prefixed with foo/*).
But now I am curious about the --branches
option of git log. It seems like that should work in a similar way, but if I use --branches=origin/foo/*
or --branches=remotes/origin/foo*
or even --branches=foo
the output is very different (only very few and irrelevant commits are showing).
The documentation say:
--branches[=<pattern>]
Pretend as if all the refs in refs/heads are listed on the command line as
<commit>. If <pattern> is given, limit branches to ones matching given shell
glob. If pattern lacks ?, *, or [, /* at the end is implied.
What is the difference ? My problem is already solved since I can use the first version - but I am asking this since I am curious. ( And also adding a git alias is slightly simpler if use of back ticks can be avoided. )
This question discusses related topics - but I could not see any info about my specific issue.