$ git-statsEstadísticas locales de GIT que incluyen calendarios de contribuciones similares a GitHub.
Tendría curiosidad por ver su calendario con todos sus compromisos. Ping Me en Twitter ( @ionicabizau ). ? Hasta entonces, aquí está mi calendario:
Instalación
Uso
Documentación
Cómo contribuir
Puede instalar el paquete a nivel mundial y usarlo como herramienta de línea de comandos:
# 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 Luego, ejecute git-stats --help y vea qué puede hacer la herramienta 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.
Sé que no es bueno comenzar tu calendario Git Commit desde cero. Es por eso que creé git-stats-importer , una herramienta que importa o elimina las confirmaciones de los repositorios seleccionados.
Míralo aquí: https://github.com/ionicabizau/git-stats-importer
El uso es simple:
# 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 --deleteSí, eso también es posible. ¡Construí una herramienta que descargue y luego importe todos los compromisos que ha empujado a Github y 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 Si desea visualizar los calendarios que aparecen en los perfiles de GitHub, puede hacerlo usando ghcal .
# Install ghcal
$ npm install -g ghcal
# Check out @alysonla's contributions
$ ghcal -u alysonlaPara obtener una documentación más detallada, consulte el repositorio: https://github.com/ionicabizau/ghcal.
Si desea obtener aún más estadísticas de GitHub en su terminal, es posible que desee probar github-stats , esto es como git-stats pero con datos tomados de GitHub.
Puede ajustar el comportamiento de git-stats utilizando un archivo de configuración en su directorio de inicio: ~/.git-stats-config.js .
Este archivo debe exportar un objeto, como a continuación (se enumeran los valores predeterminados):
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
} ; Dado que es un archivo JS, puede require cualquier otro módulo allí.
git-stats --raw emite formato JSON RAW que pueden ser consumidos por otras herramientas para generar resultados como archivos o imágenes HTML.
git-stats-html interpreta los datos JSON y genera un archivo HTML. Ejemplo:
# 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
Después de tener el archivo HTML, podemos generar un archivo de imagen usando pageres de @sindresorhus :
# Install pageres
npm install -g pageres-cli
# Generate the image from HTML
pageres out.html 775x250
git-stats está funcionando bien en emuladores terminales que apoyan los estilos de ANSI. Debería funcionar bien en Linux y OS X.
Si ejecuta git-stats para mostrar el gráfico en Windows, utilice un terminal que pueda mostrar correctamente los colores ANSI.
Se sabe que el terminal Cygwin funciona, mientras que el aviso del sistema de Windows y Git Bash no lo hacen. ¡Las mejoras son más que bienvenidas! ?
Aquí hay un ejemplo de cómo usar este paquete como biblioteca. Para instalarlo localmente, como biblioteca, puede usar npm install git-stats (o 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 ) ;
} ) ; Hay pocas formas de obtener ayuda:
Para obtener referencia completa de API, consulte el archivo Documation.md.
¿Tienes una idea? Encontrado un error? Vea cómo contribuir.
De código abierto casi todo lo que pueda, y trato de responder a todos los que necesitan ayuda para usar estos proyectos. Obviamente, esto lleva tiempo. ¡Puede integrar y usar estos proyectos en sus aplicaciones de forma gratuita ! Incluso puede cambiar el código fuente y redistribuir (incluso revenderlo).
Sin embargo, si obtienes algunas ganancias de esto o simplemente quieres alentarme a continuar creando cosas, hay pocas formas en que puedes hacerlo:
Protagonizar y compartir los proyectos que te gustan
—El lo amo a los libros! Te recordaré después de años si me compras uno. ?
—Se puede hacer donaciones únicas a través de PayPal. Probablemente compraré un café té. ?
—Enea una donación mensual recurrente y obtendrá noticias interesantes sobre lo que estoy haciendo (cosas que no comparto con todos).
Bitcoin : puede enviarme bitcoins a esta dirección (o escanear el código a continuación): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
¡Gracias! ❤️
Si está utilizando esta biblioteca en uno de sus proyectos, agrégala en esta lista.
git-stats-importergit-stats-fcc-importerMIT © Ionică Bizău