Skip to content

Commit c30cb1e

Browse files
committed
Updated docs
1 parent f550eab commit c30cb1e

File tree

4 files changed

+733
-9
lines changed

4 files changed

+733
-9
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@
44
*.log
55
node_modules
66
*.env
7-
.DS_Store
8-
package-lock.json

README.md

+37-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
22

3-
43
[![git-stats](http://i.imgur.com/Q7TQYHx.png)](#)
54

65
# `$ git-stats`
76

8-
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/git-stats.svg)](https://www.npmjs.com/package/git-stats) [![Downloads](https://img.shields.io/npm/dt/git-stats.svg)](https://www.npmjs.com/package/git-stats)
7+
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Version](https://img.shields.io/npm/v/git-stats.svg)](https://www.npmjs.com/package/git-stats) [![Downloads](https://img.shields.io/npm/dt/git-stats.svg)](https://www.npmjs.com/package/git-stats)
98

109
> Local git statistics including GitHub-like contributions calendars.
1110
@@ -16,15 +15,16 @@ I'd be curious to see your calendar with all your commits. Ping me on Twitter ([
1615

1716
## Contents
1817

19-
- [Installation](#installation)
18+
19+
- [Installation](#cloud-installation)
2020
- [Usage](#usage)
2121

2222
- [Importing and deleting commits](#importing-and-deleting-commits)
2323
- [Importing all the commits from GitHub and BitBucket](#importing-all-the-commits-from-github-and-bitbucket)
2424
- [What about the GitHub Contributions calendar?](#what-about-the-github-contributions-calendar)
2525

26-
- [Documentation](#documentation)
27-
- [How to contribute](#how-to-contribute)
26+
- [Documentation](#memo-documentation)
27+
- [How to contribute](#yum-how-to-contribute)
2828

2929

3030
## :cloud: Installation
@@ -40,6 +40,7 @@ npm i -g git-stats
4040
curl -s https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash
4141
```
4242

43+
4344
Then, run `git-stats --help` and see what the CLI tool can do.
4445

4546

@@ -79,8 +80,10 @@ Documentation can be found at https://github.com/IonicaBizau/git-stats.
7980
```
8081

8182
## Usage
83+
8284
### Importing and deleting commits
8385

86+
8487
I know it's not nice to start your git commit calendar from scratch. That's why I created [`git-stats-importer`](https://github.com/IonicaBizau/git-stats-importer)–a tool which imports or deletes the commits from selected repositories.
8588

8689
Check it out here: https://github.com/IonicaBizau/git-stats-importer
@@ -100,8 +103,10 @@ $ git-stats-importer
100103
# ...or delete them if that's a dummy repository
101104
$ git-stats-importer --delete
102105
```
106+
103107
### Importing all the commits from GitHub and BitBucket
104108

109+
105110
Yes, that's also possible. I [built a tool which downloads and then imports all the commits you have pushed to GitHub and BitBucket](https://github.com/IonicaBizau/repository-downloader)!
106111

107112
```sh
@@ -117,8 +122,10 @@ $ npm install
117122
# Start downloading and importing
118123
$ ./start
119124
```
125+
120126
### What about the GitHub Contributions calendar?
121127

128+
122129
If you want to visualize the calendars that appear on GitHub profiles, you can do that using [`ghcal`](https://github.com/IonicaBizau/ghcal).
123130

124131
```sh
@@ -129,12 +136,14 @@ $ npm install -g ghcal
129136
$ ghcal -u alysonla
130137
```
131138

139+
132140
For more detailed documentation, check out the repository: https://github.com/IonicaBizau/ghcal.
133141

134142
If want to get even more GitHub stats in your terminal, you may want to try [`github-stats`](https://github.com/IonicaBizau/github-stats)--this is like `git-stats` but with data taken from GitHub.
135143

136144
## Using the configuration file
137145

146+
138147
You can tweak the git-stats behavior using a configuration file in your home directory: `~/.git-stats-config.js`.
139148

140149
This file should export an object, like below (defaults are listed):
@@ -168,37 +177,59 @@ module.exports = {
168177
};
169178
```
170179

180+
171181
Since it's a js file, you can `require` any other modules there.
172182

173183
## Saving the data as HTML and images
174184

185+
175186
`git-stats --raw` outputs raw JSON format which can be consumed by other tools to generate results such as HTML files or images.
176187

177188
[`git-stats-html`](https://github.com/IonicaBizau/git-stats-html) interprets the JSON data and generates an HTML file. Example:
178189

179190
```sh
191+
180192
# Install git-stats-html
193+
181194
npm install -g git-stats-html
182195

196+
197+
183198
# Export the data from the last year (generate out.html)
199+
184200
git-stats --raw | git-stats-html -o out.html
185201

202+
203+
186204
# Export data since 2015 (save the results in out.html)
205+
187206
git-stats --since '1 January 2015' --raw | ./bin/git-stats-html -o out.html --big
207+
188208
```
189209

210+
211+
190212
After we have the HTML file, we can generate an image file using [`pageres`](https://github.com/sindresorhus/pageres) by [**@sindresorhus**](https://github.com/sindresorhus/):
191213

192214
```sh
215+
193216
# Install pageres
217+
194218
npm install -g pageres-cli
195219

220+
221+
196222
# Generate the image from HTML
223+
197224
pageres out.html 775x250
225+
198226
```
199227

228+
229+
200230
## Cross-platform compatibility
201231

232+
202233
`git-stats` is working fine in terminal emulators supporting ANSI styles. It should work fine on Linux and OS X.
203234

204235
If you run `git-stats` to display graph on Windows, please use a terminal that can properly display ANSI colors.
@@ -264,7 +295,6 @@ this takes time. You can integrate and use these projects in your applications *
264295
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:
265296

266297
- Starring and sharing the projects you like :rocket:
267-
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
268298
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
269299
- [![Support me on Patreon][badge_patreon]][patreon]—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).
270300
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
@@ -278,6 +308,7 @@ Thanks! :heart:
278308
If you are using this library in one of your projects, add it in this list. :sparkles:
279309

280310

311+
- [`core-server`](https://github.com/SachaSkyhark/Core-Server#readme) (by Vandamme Sacha)—CoreServer
281312
- [`git-stats-fcc-importer`](https://github.com/cmal/git-stats-fcc-importer#readme) (by Yu Zhao)—git-stats importer for FreeCodeCamp users
282313
- [`git-stats-importer`](https://github.com/IonicaBizau/git-stats-importer)—Imports your commits from a repository into git-stats history.
283314

0 commit comments

Comments
 (0)