我正在尝试以下
git log --before {2.days.ago} --after {14.days.ago} --all --stat
但它似乎只给了我一个远程分支的日志。我想获取远程和本地分支的日志。
git log --before {2.days.ago} --after {14.days.ago} --all --stat --branches=* --remotes=*
你能解释一下--all、--branches=* 和--remotes=* 的作用,以及--all 是否是多余的吗?
--all
, 如git rev-list
or中所述git rev-parse
, --all 包括--branches
or --remotes
:
--all
显示在 refs/ 中找到的所有 refs。
--branches[=pattern]
--tags[=pattern]
--remotes[=pattern]
分别显示所有分支、标签或远程跟踪分支(即,分别在
refs/heads
、refs/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