我正在尝试以下操作
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=*
git rev-list
或git rev-parse
中所述,--all
包括--branches
或--remotes
。--all
--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
--all
,--branches=*
和--remotes=*
是什么意思吗?以及--all
是否多余?我看了一下 https://git-scm.com/docs/git-log ,但是有点难读,并且在 "EXAMPLES" 部分没有给出如何列出包括本地和远程所有提交的提交记录的示例,甚至没有一个使用--all
的示例。 - Andrew Grimmgit reset HEAD~1
或类似操作而“丢失”有关,其中提交仅存在于 reflog 中,而不再实际上是一个分支。 - jakeonrails