How do I run git log to see changes only for a specific branch?

前端 未结 6 945
不思量自难忘°
不思量自难忘° 2020-12-04 04:30

I have a local branch tracking the remote/master branch. After running git-pull and git-log, the log will show all commits in the remote tracking b

6条回答
  •  春和景丽
    2020-12-04 04:51

    Use:

    git log --graph --abbrev-commit --decorate  --first-parent 
    

    It is only for the target branch (of course --graph, --abbrev-commit --decorate are more polishing).

    The key option is --first-parent: "Follow only the first parent commit upon seeing a merge commit" (https://git-scm.com/docs/git-log)

    It prevents the commit forks from being displayed.

提交回复
热议问题