$ git-statsGithubのような寄付カレンダーを含むローカルGit統計。
私はあなたのすべてのコミットであなたのカレンダーを見たいと思っています。 Twitterで私をping( @ionicabizau )。 ?それまで、これが私のカレンダーです:
インストール
使用法
ドキュメント
貢献する方法
パッケージをグローバルにインストールし、コマンドラインツールとして使用できます。
# 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次に、 git-stats --help実行して、CLIツールが何ができるかを確認します。
$ 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 <path> Sets a custom data store file.
-l, --light Enables the light theme.
-n, --disable-ansi Forces the tool not to use ANSI styles.
-A, --author Filter author related contributions in the current
repository.
-a, --authors Shows a pie chart with the author related
contributions in the current repository.
-u, --until <date> Optional end date.
-s, --since <date> Optional start date.
--record <data> Records a new commit. Don't use this unless you are
a mad scientist. If you are a developer just use
this option as part of the module.
-h, --help Displays this help.
-v, --version Displays version information.
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.
gitコミットカレンダーをゼロから開始するのは良くないことを知っています。そのため、 git-stats-importerを作成しました。これは、選択したリポジトリからコミットをインポートまたは削除するツールです。
https://github.com/ionicabizau/git-stats-importerをご覧ください
使用法は簡単です:
# 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はい、それも可能です。私は、あなたがプッシュしたすべてのコミットをGithubとBitbucketにダウンロードしてインポートするツールを作成しました!
# 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 GitHubプロファイルに表示されるカレンダーを視覚化する場合は、 ghcalを使用してそれを行うことができます。
# Install ghcal
$ npm install -g ghcal
# Check out @alysonla's contributions
$ ghcal -u alysonlaより詳細なドキュメントについては、リポジトリhttps://github.com/ionicabizau/ghcalをご覧ください。
ターミナルでさらに多くのgithub統計を取得したい場合は、 github-statsを試してみることができます。これはgit-statsのようなものですが、Githubから取得したデータを使用してください。
ホームディレクトリの構成ファイルを使用してgit-statsの動作を調整できます: ~/.git-stats-config.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
} ; JSファイルであるため、他のモジュールrequire 。
git-stats --raw 、HTMLファイルや画像などの結果を生成するために他のツールによって消費できるRAW JSON形式を出力します。
git-stats-html JSONデータを解釈し、HTMLファイルを生成します。例:
# 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
HTMLファイルを取得した後、 @sindresorhusのpageresを使用して画像ファイルを生成できます。
# Install pageres
npm install -g pageres-cli
# Generate the image from HTML
pageres out.html 775x250
git-stats ANSIスタイルをサポートするターミナルエミュレーターで正常に動作しています。 LinuxとOS Xで正常に動作するはずです。
git-statsを実行してWindowsにグラフを表示する場合は、ANSIの色を適切に表示できる端末を使用してください。
Cygwinターミナルは動作することが知られていますが、WindowsコマンドプロンプトとGit Bashはそうではありません。改善は大歓迎です! ?
このパッケージをライブラリとして使用する方法の例は次のとおりです。ライブラリとしてローカルにインストールするには、 npm install git-stats (またはyarn add git-stats )をインストールできます。
// 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 ) ;
} ) ; 助けを得る方法はほとんどありません:
完全なAPIリファレンスについては、documentation.mdファイルを参照してください。
アイデアがありますか?バグを見つけましたか?貢献する方法をご覧ください。
私はできる限りすべてのものをオープンソースし、これらのプロジェクトを使用して助けを必要とするすべての人に返信しようとします。明らかに、これには時間がかかります。これらのプロジェクトをアプリケーションに統合して使用できます。ソースコードを変更して再配布することもできます(再販することもできます)。
ただし、これから何らかの利益を得るか、単にものを作成し続けるように勧めたい場合は、それを行う方法はほとんどありません。
好きなプロジェクトを主演し、共有します
- 私は本が大好きです!あなたが私にそれを買ったら、私は何年もあなたを覚えています。 ?
- PayPalを介して1回限りの寄付をすることができます。おそらく購入しますコーヒーお茶。 ?
- 毎月の寄付を繰り返すと、私がしていることについて興味深いニュースが得られます(私がみんなと共有していないこと)。
ビットコイン- このアドレスでビットコインを送ることができます(または下のコードをスキャンします): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
ありがとう! ❤❤️
プロジェクトの1つでこのライブラリを使用している場合は、このリストに追加してください。
git-stats-importergit-stats-fcc-importerMIT©IonicòBizòu