Counting Contributing Developers

JFrog Security User Guide

The git count-contributors command in JFrog CLI allows users to easily determine the number of Git developers contributing to a source code repository. This is based on unique email addresses from commit history, providing an accurate count of individual contributors according to the GIT provider API used by the JFrog CLI command.

There are several options to obtain the developer count:

  • A single code repository: Analyze a single Git repository by providing the repository name.
  • Across a project/group: Analyze multiple repositories organized under a project/group by providing the owner command option.
  • Across multiple Git servers: Analyze repositories across various Git servers by providing a YAML file as an input file with the required parameters outlined below.

Command: git count-contributors, git cc

Before You Begin

It is essential that you have:

  • JFrog CLI 2.60.0
  • One of the following supported git providers: GitHub, GitLab, Bitbucket

Info

The git count-contributors command does not use JFrog Artifactory data. Counts are based only on Git commit history, so some repositories and developers included may not interact with JFrog products

Command Parameters

OptionRequiredDefaultDescriptionExample
--scm-typeYesSCM type. One of: github, gitlab, bitbucket.--scm-type=github
--scm-api-urlYesBase URL of the SCM API endpoint.--scm-api-url=https://api.github.com
--tokenYesAuthentication token for the SCM API.--token=<token>
--ownerYesOwner/organization (project/group) of the repositories.--owner=my-org
--repo-nameNoSemicolon-separated list of repository names.--repo-name=repo1;repo2
--monthsNo1Number of months of commit history to analyze.--months=6
--detailed-summaryNofalseInclude a detailed list of contributors in the output.--detailed-summary=true
--input-fileNoPath to YAML file describing multiple Git servers to scan.--input-file="/path/to/input.yaml"
--verboseNoVerbose output.--verbose

Examples

Single Repository

jf git count-contributors \
  --scm-type=github \
  --scm-api-url=https://api.github.com \
  --token=<token> \
  --repo-name=repo1

Owner/Project (Group) Level

jf git count-contributors \
  --scm-type=gitlab \
  --scm-api-url=https://gitlab.example.com \
  --token=<token> \
  --owner=my-group

Multiple Git Servers (YAML File)

git cc --input-file="/Users/path/to/input.yaml"

Sample YAML File

git-servers-list:
  - scm-type: bitbucket
    scm-api-url: "https://api.bitbucket.example.com"
    token: "token"
    owner: "owner"
    repositories:
      - "repo1"
      - "repo2"
  - scm-type: gitlab
    scm-api-url: "https://gitlab.example.com/api/v4"
    token: "token"
    owner: "owner"

Output

Typical fields include:

  • total_unique_contributors — distinct contributors
  • total_commits — commits analyzed
  • scanned_repos — repositories scanned
  • report_date — ISO 8601 timestamp
  • number_of_months — analysis window
  • unique_contributors_list — when --detailed-summary=true