49

I'm working with a team on a git project and I would like to see the contribution of each author in terms of lines written or lines edited etc... how can I show statistics for the authors?

mikemaccana
  • 94,893
  • 84
  • 350
  • 433
Anonymous
  • 3,974
  • 3
  • 34
  • 60

5 Answers5

75

As simple as: git shortlog -s -n

Kovalex
  • 1,212
  • 1
  • 9
  • 8
21

You could try git-stats or use git command to explore from the logs

Refer following posts

  1. Graphical Stats - Generating statistics from Git repository
  2. https://gist.github.com/eyecatchup/3fb7ef0c0cbdb72412fc
  3. Which Git commit stats are easy to pull
  4. PR-Count Github App - Github ONLY. Thanks @ben
Libin Varghese
  • 1,283
  • 11
  • 19
  • 1
    You can also try github app: PR Count https://github.com/marketplace/pr-count, if you don't like command line tool. – Ben Mar 28 '20 at 19:43
7

You should have a look to repoXplorer, an open source project I develop. It is able to compute stats for a project (a group of git repositories) as well as for a contributor and a group of contributors. It provides a REST interface and a web UI. The web UI provides various information like, for a given contributor:

  • commits, lines changed and projects count
  • date histogram of commits
  • top projects by commits
  • top projects by lines changed

But best is to have a look to the demo instance here.

Here is a screenshot of the stats page of a contributor (stats are computed accross all repositories indexed by repoxplorer, but can be filtered for a specific project):

enter image description here

Fbo
  • 15,949
  • 1
  • 17
  • 9
  • Can we use this for non-github projects? – Tim Sep 26 '19 at 14:34
  • Sure, it can be used with any git repositories. It is not tied to GitHub or other hosting platforms. – Fbo Sep 27 '19 at 21:41
  • are there any instructions for that? I saw only github specific ones at least under "quickstart" – Tim Sep 28 '19 at 11:10
  • 1
    If you use the docker way, then follow the first step of the section https://github.com/morucci/repoxplorer#quickstart---use-the-repoxplorer-docker-container-to-index-a-github-organization in order to start repoXplorer. Then create a "projects.yaml" inside docker-data/conf/ by following https://github.com/morucci/repoxplorer#define-projects-to-index. The github helper is just a tool to read a github organisation from the github API to create a "projects.yaml". In your case you have to create the file manually. – Fbo Sep 29 '19 at 20:51
  • Couldn't see how to configure it for anything but github – Jonathan Ruiz Apr 02 '20 at 15:35
1

I'd suggest Gitential. It measures:

  • coding volume
  • coding hours
  • productivity
  • efficiency

and provides an analytical interface to visualize them on multiple levels:

  • projects
  • teams
  • repos
  • developers

It also deduplicates author identities and filter suspicious commits to give a better picture.

kszucs
  • 112
  • 3
0

PR Count is a github app built for showing contribution stats.

You can install for free. No need to write your own scripts or use command line tools.

Ben
  • 175
  • 1
  • 2
  • 7
  • Hi! Does the "PR Count" app work for private repos too? I installed it but not sure how to see stats. – xke Sep 09 '20 at 23:42
  • Yes, it does work for private repos. Try uninstall and install the app again. It should redirect you to prcount.com where you can see all the stats! @xke – Ben Dec 13 '20 at 23:18
  • Looks like someone may have compromised this app, it redirects to a casino domain on install. – Simon Feb 18 '22 at 17:07