$ git-statsEstatísticas do GIT local, incluindo calendários de contribuições semelhantes ao github.
Eu ficaria curioso para ver seu calendário com todos os seus compromissos. Me ping no Twitter ( @ionicabizau ). ? Até então, aqui está meu calendário:
Instalação
Uso
Documentação
Como contribuir
Você pode instalar o pacote globalmente e usá -lo como ferramenta de linha de comando:
# 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 Em seguida, execute git-stats --help e veja o que a ferramenta da CLI pode fazer.
$ 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.
Eu sei que não é bom começar seu calendário Git Commit do zero. É por isso que criei git-stats-importer -uma ferramenta que importa ou exclui os compromissos de repositórios selecionados.
Confira aqui: https://github.com/ionicabizau/git-stats-importer
O uso é simples:
# 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 --deleteSim, isso também é possível. Eu construí uma ferramenta que baixará e, em seguida, importa todas as confirmações que você pressionou para o Github e o 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 Se você deseja visualizar os calendários que aparecem nos perfis do GitHub, você pode fazer isso usando ghcal .
# Install ghcal
$ npm install -g ghcal
# Check out @alysonla's contributions
$ ghcal -u alysonlaPara uma documentação mais detalhada, consulte o repositório: https://github.com/ionicabizau/ghcal.
Se quiser obter ainda mais estatísticas do GitHub em seu terminal, você pode experimentar github-stats -isso é como git-stats , mas com dados retirados do GitHub.
Você pode ajustar o comportamento do Git-Stats usando um arquivo de configuração no seu diretório inicial: ~/.git-stats-config.js .
Este arquivo deve exportar um objeto, como abaixo (os padrões estão listados):
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
} ; Como é um arquivo JS, você pode require outros módulos lá.
git-stats --raw SAUTAS FORMAT JSON RAW, que pode ser consumido por outras ferramentas para gerar resultados, como arquivos ou imagens HTML.
git-stats-html interpreta os dados JSON e gera um arquivo HTML. Exemplo:
# 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
Depois de termos o arquivo HTML, podemos gerar um arquivo de imagem usando pageres por @sindresorhus :
# Install pageres
npm install -g pageres-cli
# Generate the image from HTML
pageres out.html 775x250
git-stats está funcionando bem nos emuladores de terminais que suportam estilos ANSI. Deve funcionar bem no Linux e OS X.
Se você executar git-stats para exibir o gráfico no Windows, use um terminal que possa exibir corretamente as cores ANSI.
Sabe -se que o Terminal Cygwin funciona, enquanto o prompt de comando do Windows e o git bash não. As melhorias são mais do que bem -vindas! ?
Aqui está um exemplo de como usar este pacote como biblioteca. Para instalá-lo localmente, como biblioteca, você pode usar npm install git-stats (ou 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 ) ;
} ) ; Existem poucas maneiras de obter ajuda:
Para referência completa da API, consulte o arquivo documentação.md.
Tem uma ideia? Encontrou um bug? Veja como contribuir.
Eu sou de código aberto quase tudo o que posso e tento responder a todos que precisam de ajuda para usar esses projetos. Obviamente, isso leva tempo. Você pode integrar e usar esses projetos em seus aplicativos gratuitamente ! Você pode até alterar o código -fonte e o redistribuição (até revenderem).
No entanto, se você obtiver algum lucro com isso ou apenas quiser me incentivar a continuar criando coisas, há poucas maneiras de fazê -lo:
Estrelando e compartilhando os projetos que você gosta
—Eu Love Livros! Vou me lembrar de você depois de anos se você me comprar um. ?
-Você pode fazer doações únicas via PayPal. Provavelmente vou comprar um café chá. ?
—Ter uma doação mensal recorrente e você receberá notícias interessantes sobre o que estou fazendo (coisas que não compartilho com todos).
Bitcoin - você pode me enviar bitcoins neste endereço (ou digitalizar o código abaixo): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Obrigado! ❤️
Se você estiver usando esta biblioteca em um de seus projetos, adicione -o nesta lista.
git-stats-importergit-stats-fcc-importerMit © ionică bizău