18

我正在尝试以下

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

但它似乎只给了我一个远程分支的日志。我想获取远程和本地分支的日志。

4

2 回答 2

16
git log --before {2.days.ago} --after {14.days.ago} --all --stat --branches=* --remotes=*
于 2013-01-29T18:29:57.310 回答
7

你能解释一下--all、--branches=* 和--remotes=* 的作用,以及--all 是否是多余的吗?

--all, 如git rev-listor中所述git rev-parse, --all 包括--branchesor --remotes:

--all

显示在 refs/ 中找到的所有 refs。

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

分别显示所有分支、标签或远程跟踪分支(即,分别在refs/headsrefs/tags或中找到的引用refs/remotes)。

如果给定模式,则仅显示与给定 shell glob 匹配的引用。
如果模式不包含通配符(?*[),则通过附加 将其转换为前缀匹配/*

参见插图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"
'

由于请求了远程分支,这应该足够了:

git log --before {2.days.ago} --after {14.days.ago} --stat --branches --remotes
于 2015-11-30T12:44:11.493 回答