$ git-statsสถิติ GIT ในท้องถิ่นรวมถึงปฏิทินการบริจาคเหมือน GitHub
ฉันอยากรู้อยากเห็นปฏิทินของคุณด้วยการกระทำทั้งหมดของคุณ ping ฉันบน 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 COMMITAR CALENDAR ตั้งแต่เริ่มต้น นั่นเป็นเหตุผลที่ฉันสร้างเครื่องมือ git-stats-importer –A ที่นำเข้าหรือลบการกระทำจากที่เก็บที่เลือก
ตรวจสอบที่นี่: 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ใช่ก็เป็นไปได้เช่นกัน ฉันสร้างเครื่องมือที่ดาวน์โหลดแล้วนำเข้า Commits ทั้งหมดที่คุณผลักดันไปยัง 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 รูปแบบ outputs 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 เป็นที่รู้จักกันในการทำงานในขณะที่ Windows Command Prompt และ 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