Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git log for range across all branches (even remote)

Tags:

git

git-log

I am trying the following

git log --before {2.days.ago} --after {14.days.ago} --all --stat

But it seems to only give me the log for one remote branch. I'd like to get the log for branches remote and local.

like image 689
bcardarella Avatar asked Jan 29 '13 17:01

bcardarella


2 Answers

git log --before {2.days.ago} --after {14.days.ago} --all --stat --branches=* --remotes=*
like image 108
jakeonrails Avatar answered Oct 09 '22 23:10

jakeonrails


Can you explain what --all, --branches=* and --remotes=* do, and whether the --all is redundant or not?

--all, as mentioned in git rev-list or git rev-parse, --all include --branches or --remotes:

--all

Show all refs found in refs/.

--branches[=pattern]
--tags[=pattern]
--remotes[=pattern]

Show all branches, tags, or remote-tracking branches, respectively (i.e., refs found in refs/heads, refs/tags, or refs/remotes, respectively).

If a pattern is given, only refs matching the given shell glob are shown.
If the pattern does not contain a globbing character (?, *, or [), it is turned into a prefix match by appending /*.

See as an illustration t/t6018-rev-list-glob.sh#L136-L138:

test_expect_success 'rev-parse --exclude with --all' '
    compare rev-parse "--exclude=refs/remotes/* --all" "--branches --tags"
'

Since remote branches are requested, this should be enough:

git log --before {2.days.ago} --after {14.days.ago} --stat --branches --remotes
like image 34
VonC Avatar answered Oct 10 '22 00:10

VonC