https://github.com/ionicabizau/git-stats
🍀 Local git statistics including GitHub-like contributions calendars.
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 28 committers (3.6%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.0%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
🍀 Local git statistics including GitHub-like contributions calendars.
Basic Info
Statistics
- Stars: 6,542
- Watchers: 58
- Forks: 188
- Open Issues: 13
- Releases: 55
Topics
Metadata Files
README.md
$ git-stats
Local git statistics including GitHub-like contributions calendars.
I'd be curious to see your calendar with all your commits. Ping me on Twitter (@IonicaBizau). :smile: Until then, here's my calendar:

Contents
:cloud: Installation
You can install the package globally and use it as command line tool:
```sh
Install the package globally
npm i -g git-stats
Initialize git hooks
This is for tracking the new commits
curl -s https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash ```
Then, run git-stats --help and see what the CLI tool can do.
``` $ git-stats --help Usage: git-stats [options]
Local git statistics including GitHub-like contributions calendars.
Options:
-r, --raw Outputs a dump of the raw JSON data.
-g, --global-activity Shows global activity calendar in the current
repository.
-d, --data
Examples: $ git-stats # Default behavior (stats in the last year) $ git-stats -l # Light mode $ git-stats -s '1 January, 2012' # All the commits from 1 January 2012 to now $ git-stats -s '1 January, 2012' -u '31 December, 2012' # All the commits from 2012
Your commit history is kept in ~/.git-stats by default. You can create ~/.git-stats-config.js to specify different defaults.
Documentation can be found at https://github.com/IonicaBizau/git-stats. ```
Usage
Importing and deleting commits
I know it's not nice to start your git commit calendar from scratch. That's why I created git-stats-importer–a tool which imports or deletes the commits from selected repositories.
Check it out here: https://github.com/IonicaBizau/git-stats-importer
The usage is simple:
```sh
Install the importer tool
$ npm install -g git-stats-importer
Go to the repository you want to import
$ cd path/to/my-repository
Import the commits
$ git-stats-importer
...or delete them if that's a dummy repository
$ git-stats-importer --delete ```
Importing all the commits from GitHub and BitBucket
Yes, that's also possible. I built a tool which downloads and then imports all the commits you have pushed to GitHub and BitBucket!
```sh
Download the repository downloader
$ git clone https://github.com/IonicaBizau/repository-downloader.git
Go to repository downloader
$ cd repository-downloader
Install the dependencies
$ npm install
Start downloading and importing
$ ./start ```
What about the GitHub Contributions calendar?
If you want to visualize the calendars that appear on GitHub profiles, you can do that using ghcal.
```sh
Install ghcal
$ npm install -g ghcal
Check out @alysonla's contributions
$ ghcal -u alysonla ```
For more detailed documentation, check out the repository: https://github.com/IonicaBizau/ghcal.
If want to get even more GitHub stats in your terminal, you may want to try github-stats--this is like git-stats but with data taken from GitHub.
Using the configuration file
You can tweak the git-stats behavior using a configuration file in your home directory: ~/.git-stats-config.js.
This file should export an object, like below (defaults are listed):
```js module.exports = { // "DARK", "LIGHT" or an object interpreted by IonicaBizau/node-git-stats-colors "theme": "DARK"
// The file where the commit hashes will be stored
, "path": "~/.git-stats"
// [DEPRECATED] First day of the week https://github.com/IonicaBizau/git-stats/issues/121
, first_day: "Sun"
// This defaults to *one year ago*
// It can be any parsable date
, since: undefined
// This defaults to *now*
// It can be any parsable date
, until: undefined
// Don't show authors by default
// If true, this will enable the authors pie
, authors: false
// No global activity by default
// If true, this will enable the global activity calendar in the current project
, global_activity: false }; ```
Since it's a js file, you can require any other modules there.
Saving the data as HTML and images
git-stats --raw outputs raw JSON format which can be consumed by other tools to generate results such as HTML files or images.
git-stats-html interprets the JSON data and generates an HTML file. Example:
```sh
Install git-stats-html
npm install -g git-stats-html
Export the data from the last year (generate out.html)
git-stats --raw | git-stats-html -o out.html
Export data since 2015 (save the results in out.html)
git-stats --since '1 January 2015' --raw | ./bin/git-stats-html -o out.html --big
```
After we have the HTML file, we can generate an image file using pageres by @sindresorhus:
```sh
Install pageres
npm install -g pageres-cli
Generate the image from HTML
pageres out.html 775x250
```
Cross-platform compatibility
git-stats is working fine in terminal emulators supporting ANSI styles. It should work fine on Linux and OS X.
If you run git-stats to display graph on Windows, please use a terminal that can properly display ANSI colors.
Cygwin Terminal is known to work, while Windows Command Prompt and Git Bash do not. Improvements are more than welcome! :dizzy:
:clipboard: Example
Here is an example how to use this package as library. To install it locally, as library, you can use npm install git-stats (or yarn add git-stats):
```js // Dependencies var GitStats = require("git-stats");
// Create the GitStats instance var g1 = new GitStats();
// Display the ansi calendar g1.ansiCalendar({ theme: "DARK" }, function (err, data) { console.log(err || data); }); ```
:memo: Documentation
For full API reference, see the DOCUMENTATION.md file.
:question: Get Help
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. :bug:
- For direct and quick help, you can use Codementor. :rocket:
:newspaper: Press Highlights
:yum: How to contribute
Have an idea? Found a bug? See how to contribute.
:sparkling_heart: Support my projects
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
- Starring and sharing the projects you like :rocket:
—I love books! I will remember you after years if you buy me one. :grin: :book:
—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
Bitcoin—You can send me bitcoins at this address (or scanning the code below):
1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! :heart:
:dizzy: Where is this library used?
If you are using this library in one of your projects, add it in this list. :sparkles:
git-stats-fcc-importergit-stats-importer
:scroll: License
Owner
- Name: Ionică Bizău (Johnny B.)
- Login: IonicaBizau
- Kind: user
- Location: ✈
- Company: @Bloggify @BibleJS @BrainJS
- Website: https://ionicabizau.net
- Twitter: IonicaBizau
- Repositories: 520
- Profile: https://github.com/IonicaBizau
Programmer, Geek, Pianist & Organist, Learner, Mentor, Dreamer, Vegetarian, Jesus follower, Founder @Bloggify
GitHub Events
Total
- Create event: 5
- Release event: 2
- Issues event: 5
- Watch event: 142
- Push event: 5
- Pull request event: 6
- Fork event: 7
Last Year
- Create event: 5
- Release event: 2
- Issues event: 5
- Watch event: 142
- Push event: 5
- Pull request event: 6
- Fork event: 7
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Ionică Bizău | b****a@g****m | 318 |
| William Boman | w****m@r****e | 6 |
| Fabian Furger | f****n@h****m | 5 |
| Alexander Mart | a****l@g****m | 3 |
| Jonah Lawrence | j****h@f****m | 3 |
| dependabot[bot] | 4****] | 3 |
| as0n | a****n@g****r | 2 |
| Mordechai Zuber | m****3@g****m | 2 |
| Alejandro Romero | a****7@g****m | 2 |
| Adrian Darian | a****n@u****u | 1 |
| Sam Brightman | s****n@i****l | 1 |
| “Agustín | a****z@i****m | 1 |
| Ben Hollomon | b****n | 1 |
| Flávio Ribeiro | f****o@c****m | 1 |
| Islam Magdy | i****m@i****m | 1 |
| Justin Hurley | j****8@g****m | 1 |
| Lee Sun-Hyoup | k****r@n****m | 1 |
| Linquize | l****e@y****k | 1 |
| Owen Young | t****g@g****m | 1 |
| Rafael Corrêa Gomes | r****z@h****m | 1 |
| René Föhring | rf@b****e | 1 |
| Ryan Seys | r****n@r****m | 1 |
| Sanket Dasgupta | s****a@g****m | 1 |
| Yoan Blanc | y****n@d****h | 1 |
| johannjacobsohn | j****n@d****m | 1 |
| Joey Hipolito | hi@j****e | 1 |
| Tyler | h****r@g****m | 1 |
| simopunkc | p****h@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 64
- Total pull requests: 52
- Average time to close issues: about 1 year
- Average time to close pull requests: 23 days
- Total issue authors: 59
- Total pull request authors: 21
- Average comments per issue: 2.7
- Average comments per pull request: 0.37
- Merged pull requests: 40
- Bot issues: 0
- Bot pull requests: 5
Past Year
- Issues: 4
- Pull requests: 5
- Average time to close issues: about 20 hours
- Average time to close pull requests: less than a minute
- Issue authors: 4
- Pull request authors: 2
- Average comments per issue: 0.25
- Average comments per pull request: 0.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- da1nerd (2)
- trosh (2)
- tir38 (2)
- cmal (2)
- ErikLacharite (2)
- theladyjaye (1)
- RijnBuve-TomTom (1)
- blvz (1)
- arlevy (1)
- sgregson (1)
- lfjeff (1)
- philadams-zz (1)
- Sevyls (1)
- Neola (1)
- Fairfarren (1)
Pull Request Authors
- IonicaBizau (28)
- dependabot[bot] (5)
- simopunkc (2)
- theowenyoung (1)
- anshul-132002 (1)
- alexander-mart (1)
- adriandarian (1)
- DenverCoder1 (1)
- iMagdy (1)
- huntr-helper (1)
- greut (1)
- SyedAahana (1)
- agurodriguez (1)
- Vagdevi007 (1)
- benhollomon (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- abs 1.3.14
- add-subtract-date 1.0.15
- ansi-parser 3.2.10
- ansi-parser 3.0.0
- ansi-regex 4.1.1
- ansi-styles 3.2.1
- ansy 1.0.15
- arrs-to-obj 1.0.12
- auto-parse 1.8.0
- barbe 3.0.16
- bug-killer 4.4.4
- byline 4.2.2
- camelo 1.2.1
- class-methods 1.0.12
- cli-box 6.0.10
- cli-box 5.0.0
- cli-circle 3.2.11
- cli-gh-cal 1.4.13
- cli-graph 3.2.2
- cli-pie 2.4.2
- clp 4.0.12
- color-convert 1.9.3
- color-name 1.1.3
- couleurs 5.2.1
- couleurs 5.0.0
- couleurs 6.0.11
- custom-return 1.0.12
- date-unit-ms 1.1.14
- daty 1.2.1
- days 1.1.1
- debug-mode 2.0.2
- deffy 2.0.0
- deffy 2.2.4
- define-property 1.0.0
- diff-dates 1.0.14
- err 2.1.12
- exclude-arr 1.0.11
- exec-limiter 3.2.13
- fillo 1.0.13
- flat-colors 3.0.0
- flatcolors 3.0.0
- formatoid 1.2.4
- function.name 1.0.13
- git-stats-colors 2.3.13
- gitlog-parser 0.0.4
- gry 6.1.0
- has-flag 1.0.0
- indento 1.1.13
- is-accessor-descriptor 1.0.0
- is-buffer 1.1.6
- is-data-descriptor 1.0.0
- is-descriptor 1.0.2
- is-empty-obj 1.0.12
- is-number 2.1.0
- is-number 3.0.0
- is-there 4.5.1
- is-undefined 1.0.11
- is-win 1.0.10
- iterate-object 1.3.4
- kind-of 6.0.3
- kind-of 3.2.2
- last-char 1.3.11
- le-table 6.1.10
- limit-it 3.2.10
- match-it 1.0.9
- moment 2.29.3
- months 1.2.0
- noop6 1.0.9
- obj-def 1.0.9
- one-by-one 3.2.8
- overlap 2.2.10
- parse-it 1.0.10
- prompt-sync 4.2.0
- promptify 2.0.1
- r-json 1.2.10
- regex-escape 3.4.10
- remove-blank-lines 1.4.1
- sliced 1.0.1
- static-methods 1.0.12
- strip-ansi 5.2.0
- supports-color 3.2.3
- tilda 4.4.16
- typpy 2.0.0
- typpy 2.3.11
- typpy 2.3.13
- uc-first-array 1.1.10
- ucfirst 1.0.0
- ul 5.0.0
- ul 5.2.15
- w-json 1.3.10
- window-size 1.1.1
- wrap-text 1.0.9
- x256 0.0.2
- abs ^1.0.0
- bug-killer ^4.0.0
- cli-gh-cal ^1.4.0
- cli-pie ^2.0.0
- deffy ^2.2.2
- gitlog-parser 0.0.4
- gry ^6.1.0
- is-there ^4.0.0
- iterate-object ^1.1.0
- moment ^2.29.3
- r-json ^1.0.0
- tilda ^4.3.3
- typpy ^2.1.0
- ul ^5.0.0
- w-json ^1.0.0

