<commit_before>![](http://i.imgur.com/Q7TQYHx.png)
# `$ git-stats`
A GitHub-like contributions calendar, but locally, with all your git commits.

These are all my real commits from the last year.

![](http://i.imgur.com/LfLJAaE.png)

## Contents

 - [Installation](https://github.com/IonicaBizau/git-stats#installation)
 - [Catching the `git commit` command](https://github.com/IonicaBizau/git-stats#catching-the-git-commit-command)
   - [Using `git` hooks](https://github.com/IonicaBizau/git-stats#using-git-hooks)
   - [Overriding the `git` command](https://github.com/IonicaBizau/git-stats#overriding-the-git-command)
 - [Usage](https://github.com/IonicaBizau/git-stats#usage)
   - [Importing and deleting commits](https://github.com/IonicaBizau/git-stats#importing-and-deleting-commits)
   - [Importing all the commits from GitHub and BitBucket](https://github.com/IonicaBizau/git-stats#importing-all-the-commits-from-github-and-bitbucket)
   - [See the GitHub Contributions calendar](https://github.com/IonicaBizau/git-stats#see-the-github-contributions-calendar)
 - [Documentation](https://github.com/IonicaBizau/git-stats#documentation-)
 - [How to contribute](https://github.com/IonicaBizau/git-stats#how-to-contribute)

## Installation
```sh
$ npm install -g git-stats
```

### Catching the `git commit` command
Would you like to catch and automatically store the commits when you do `git commit`? If so, try one of the following solutions.

#### Using `git` hooks
The way I recommend to track your git commits is to use git hooks. Run the following command to initialize the `post-commit` git hook.

```sh
# Using curl
curl -s https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash

# ...or wget
wget -qO- https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash
```

Then, you have to run `git init` into your existing git repositories from your local machine (that's because the `post-commit` should be updated). This
step will not be needed after cloning a repository (the git hooks will be added automatically from `~/.git-templates`).<commit_msg>Keep only hash links in contents.<commit_after>![](http://i.imgur.com/Q7TQYHx.png)
# `$ git-stats`
A GitHub-like contributions calendar, but locally, with all your git commits.

These are all my real commits from the last year.

![](http://i.imgur.com/LfLJAaE.png)

## Contents

 - [Installation](#installation)
 - [Catching the `git commit` command](#catching-the-git-commit-command)
   - [Using `git` hooks](#using-git-hooks)
   - [Overriding the `git` command](#overriding-the-git-command)
 - [Usage](#usage)
   - [Importing and deleting commits](#importing-and-deleting-commits)
   - [Importing all the commits from GitHub and BitBucket](#importing-all-the-commits-from-github-and-bitbucket)
   - [See the GitHub Contributions calendar](#see-the-github-contributions-calendar)
 - [Documentation](#documentation-)
 - [How to contribute](#how-to-contribute)

## Installation
```sh
$ npm install -g git-stats
```

### Catching the `git commit` command
Would you like to catch and automatically store the commits when you do `git commit`? If so, try one of the following solutions.

#### Using `git` hooks
The way I recommend to track your git commits is to use git hooks. Run the following command to initialize the `post-commit` git hook.

```sh
# Using curl
curl -s https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash

# ...or wget
wget -qO- https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash
```

Then, you have to run `git init` into your existing git repositories from your local machine (that's because the `post-commit` should be updated). This
step will not be needed after cloning a repository (the git hooks will be added automatically from `~/.git-templates`).
{'fraction_non_alphanumeric': 0.1336228921819111, 'fraction_numerical': 0.000510986203372509, 'mean_word_length': 4.475524475524476, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2286955', 'n_tokens_mistral': 1300, 'n_tokens_neox': 1209, 'n_words': 356}