$ git-statsإحصائيات GIT المحلية بما في ذلك التقويمات المساهمات الشبيهة بالجيثب.
سأكون فضوليًا لرؤية التقويم الخاص بك مع كل الالتزامات الخاصة بك. Ping Me على Twitter ( @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-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 يخرج تنسيق JSON الخام والذي يمكن استهلاكه بواسطة أدوات أخرى لإنشاء نتائج مثل ملفات HTML أو الصور.
يفسر 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 ، يمكننا إنشاء ملف صورة باستخدام pageres بواسطة sindresorhus :
# 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 Terminal تعمل ، في حين أن موجه أوامر 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. ربما سأشتري أ قهوة شاي. ؟
- قم بإجراء تبرع شهري متكرر وستحصل على أخبار مثيرة للاهتمام حول ما أقوم به (أشياء لا أشاركها مع الجميع).
Bitcoin - يمكنك أن ترسل لي Bitcoins على هذا العنوان (أو مسح الكود أدناه): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
شكرًا! ❤
إذا كنت تستخدم هذه المكتبة في أحد مشاريعك ، فأضفها في هذه القائمة.
git-stats-importergit-stats-fcc-importerMIT © ionică bizău