Peiquan Cheng
Peiquan Cheng

git-commit-analytics

作者:程沛权2022-01-02

本文最后更新于 910 天前,部分内容可能不适合当前所有情况,仅供参考。

A tool to analyze your git repository’s commit log. It can help you generate daily/weekly or longer work reports.

git-commit-analytics

Download

This is a client tool, so you need to download the program to use it. See: The Latest Release to download.

Change Log

You can look at the CHANGELOG to understand the content of each update.

Usage

Create and fill in your configuration file, and then run the program to get your work report.

Configuration

You need to create a config.json at the same folder with the program, and write the content in the following format.

{
  "lang": "en",
  "authors": [
    "chengpeiquan"
  ],
  "dateRange": [
    "2021-12-01",
    "2022-01-31"
  ],
  "repos": [
    "D:\\Git\\git-commit-analytics"
  ],
  "format": {
    "git-commit-analytics": "Git Commit Analytics"
  },
  "includes": [
    "feat",
    "fix",
    "docs",
    "style",
    "refactor",
    "test",
    "chore"
  ],
  "excludes": [
    "typo",
    "backup",
    "progress"
  ]
}

The configuration items are described as follows:

keytypedescription
langstringSet program default language, support en (English) and zh (Simplified Chinese).
authorsstring[]Filter the author name of commits, support multiple author names, for you may have different names in different repos.
dateRange[string, string]Fill in [start date, end date], support the legal time format, and count from the start date 00:00:00 to the end date 23:59:59.
reposstring[]The Git repo folder on your computer, need to be switched to the branch you want to count.
format{ [key: string]: string }Format your folder name as the project name.
includesstring[]The commit message prefix to be included in the statistics.
excludesstring[]In the statistical results, exclude commit messages that contain these keywords.

Among them, authors / includes / excludes will be created as regular expressions to match data.

Report

The report file will be generated in markdown syntax (probably the most common format for developer?) and saved as a file in .txt format (probably the most compatible format?).

The project name will be classified as the second-level title, and 7 types of commit prefixes will be classified as the third-level title:

typedescription
featFeatures
fixBug Fixes
docsDocumentation
styleOptimized Style
refactorRefactored
testTest Cases
choreChores

You can click Commit message and Change log writing guide to learn how to standardize the git commit.