List all developers on a project in Git

后端 未结 9 2085
半阙折子戏
半阙折子戏 2020-12-07 08:25

Is it possible to list all users that contributed to a project (users that have done commits) in Git?

Any additional statistics?

9条回答
  •  遥遥无期
    2020-12-07 08:50

    (users that have done commits)

    Note: by default git shortlog groups commits by authors.

    If you need to group them by committers, you will need Git 2.12 (Q1 2017)

    git shortlog -snc
    

    See commit 03f4082 (16 Dec 2016) by Jeff King (peff).
    See commit fbfda15 (11 Oct 2016) by Linus Torvalds (torvalds).
    (Merged by Junio C Hamano -- gitster -- in commit ad1b4e2, 27 Dec 2016)

    Linus Torvalds himself introduces this feature:

    shortlog: group by committer information

    In some situations you may want to group the commits not by author, but by committer instead.

    For example, when I just wanted to look up what I'm still missing from linux-next in the current merge window, I don't care so much about who wrote a patch, as what git tree it came from, which generally boils down to "who committed it".

    So make git shortlog take a "-c" or "--committer" option to switch grouping to that.

提交回复
热议问题