Does git log --branches work?

前端 未结 5 988
北荒
北荒 2020-12-28 12:44

I can\'t seem to get git log --branches to correctly filter its output. It seems as if Git ignores it.

For example, the head of git log --graph --

5条回答
  •  感动是毒
    2020-12-28 13:26

    Explanation of --branches

    git log lists all commits that are reachable from any that you list on the command line.

    • --all does the same but pretends that you listed all the refs in refs/.

    • --branches[=] does the same but pretends that you listed all the refs in refs/heads. It also allows you to limit with a glob pattern. As a gotcha, if your glob pattern lacks ?, , or [, then an / at the end is implied.

    Examples

    git log topic1 topic2 topic3

    means list all the commits reachable from topic1, topic2, or topic3.

    git log -all

    means list all the commits that are reachable from any of the refs that are output from git show-ref.

    git log --branches="topic*"

    means list all the commits that are reachable from from any branch that starts with the prefix topic.

    Sources

    https://schacon.github.io/git/git-log.html

    https://schacon.github.io/git/git-rev-list.html

提交回复
热议问题