You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-6
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,10 @@
1
1
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
2
2
3
-
4
3
[](#)
5
4
6
5
# `$ git-stats`
7
6
8
-
[![Support me on Patreon][badge_patreon]][patreon][![Buy me a book][badge_amazon]][amazon][![PayPal][badge_paypal_donate]][paypal-donations][](https://github.com/IonicaBizau/ama)[](https://www.npmjs.com/package/git-stats)[](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][](https://www.npmjs.com/package/git-stats)[](https://www.npmjs.com/package/git-stats)
9
8
10
9
> Local git statistics including GitHub-like contributions calendars.
11
10
@@ -16,15 +15,16 @@ I'd be curious to see your calendar with all your commits. Ping me on Twitter ([
16
15
17
16
## Contents
18
17
19
-
-[Installation](#installation)
18
+
19
+
-[Installation](#cloud-installation)
20
20
-[Usage](#usage)
21
21
22
22
-[Importing and deleting commits](#importing-and-deleting-commits)
23
23
-[Importing all the commits from GitHub and BitBucket](#importing-all-the-commits-from-github-and-bitbucket)
24
24
-[What about the GitHub Contributions calendar?](#what-about-the-github-contributions-calendar)
Then, run `git-stats --help` and see what the CLI tool can do.
44
45
45
46
@@ -79,8 +80,10 @@ Documentation can be found at https://github.com/IonicaBizau/git-stats.
79
80
```
80
81
81
82
## Usage
83
+
82
84
### Importing and deleting commits
83
85
86
+
84
87
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.
85
88
86
89
Check it out here: https://github.com/IonicaBizau/git-stats-importer
@@ -100,8 +103,10 @@ $ git-stats-importer
100
103
# ...or delete them if that's a dummy repository
101
104
$ git-stats-importer --delete
102
105
```
106
+
103
107
### Importing all the commits from GitHub and BitBucket
104
108
109
+
105
110
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)!
106
111
107
112
```sh
@@ -117,8 +122,10 @@ $ npm install
117
122
# Start downloading and importing
118
123
$ ./start
119
124
```
125
+
120
126
### What about the GitHub Contributions calendar?
121
127
128
+
122
129
If you want to visualize the calendars that appear on GitHub profiles, you can do that using [`ghcal`](https://github.com/IonicaBizau/ghcal).
123
130
124
131
```sh
@@ -129,12 +136,14 @@ $ npm install -g ghcal
129
136
$ ghcal -u alysonla
130
137
```
131
138
139
+
132
140
For more detailed documentation, check out the repository: https://github.com/IonicaBizau/ghcal.
133
141
134
142
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.
135
143
136
144
## Using the configuration file
137
145
146
+
138
147
You can tweak the git-stats behavior using a configuration file in your home directory: `~/.git-stats-config.js`.
139
148
140
149
This file should export an object, like below (defaults are listed):
@@ -168,37 +177,59 @@ module.exports = {
168
177
};
169
178
```
170
179
180
+
171
181
Since it's a js file, you can `require` any other modules there.
172
182
173
183
## Saving the data as HTML and images
174
184
185
+
175
186
`git-stats --raw` outputs raw JSON format which can be consumed by other tools to generate results such as HTML files or images.
176
187
177
188
[`git-stats-html`](https://github.com/IonicaBizau/git-stats-html) interprets the JSON data and generates an HTML file. Example:
178
189
179
190
```sh
191
+
180
192
# Install git-stats-html
193
+
181
194
npm install -g git-stats-html
182
195
196
+
197
+
183
198
# Export the data from the last year (generate out.html)
199
+
184
200
git-stats --raw | git-stats-html -o out.html
185
201
202
+
203
+
186
204
# Export data since 2015 (save the results in out.html)
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/):
191
213
192
214
```sh
215
+
193
216
# Install pageres
217
+
194
218
npm install -g pageres-cli
195
219
220
+
221
+
196
222
# Generate the image from HTML
223
+
197
224
pageres out.html 775x250
225
+
198
226
```
199
227
228
+
229
+
200
230
## Cross-platform compatibility
201
231
232
+
202
233
`git-stats` is working fine in terminal emulators supporting ANSI styles. It should work fine on Linux and OS X.
203
234
204
235
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 *
264
295
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:
265
296
266
297
- 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:
268
298
-[![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
269
299
-[![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).
270
300
-**Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
@@ -278,6 +308,7 @@ Thanks! :heart:
278
308
If you are using this library in one of your projects, add it in this list. :sparkles:
0 commit comments