• News

All About Git Pretty Stats

4Shares
574Views

The raw performance of Git Pretty Statsis very strong when compared to many other tools. New changes, branching, merging, and comparing old versions are all done in a way that makes them faster. The algorithms inside Git Pretty Stats use a lot of information about how real source code file trees are built, how they change over time, and how users get to them.

Git Pretty Stats

You know those cool graphs and statistics that you can get for a repository on github that are so fun to look at? Because of a variety of reasons, not all git repositories are on github, which is a bad thing. This is the PHP tool that you can use to make graphs for your repository. It can be used anywhere, and it looks great.

Features (v0.2.1)

  • Handles multiple repositories
  • Handles bare repositories
  • Statistics
  • Total commits
  • Total contributors
  • Average commits per contributor
  • First commit date
  • Latest commit date
  • Active for (X days)
  • Average commits per day
  • Graphs
  • Commits by date
  • Commits by hour of day
  • Commits by day of week
  • Commits by contributor

Installation

Install dependencies using Composer.

php composer.phar install

You also need to give permission to the storage folder where you keep your apps.

chmod -R 777 app/storage

To get stats and graphs for the repositories you want, copy them into the folder called "repositories."

cd repositories git clone < repository-url >

You can clone as many as you want into this folder, and you can put them in this one.

Web Server Configuration

  • Apache
  • NginX

Configuration

To manually override configuration, start by copying app/config/git-pretty-stats.php to app/config/local/git-pretty-stats.php. Then you can configure the following in that file:

Custom Directory For Repositories

Set the repositoriesPath to a relative path where you store your repositories.

'repositoriesPath' => '../../repositories'

Specify Each Repository Path

Set the repositoriesPath to an array of paths. They can be either relative or absolute.

'repositoriesPath' => array( '/var/www/web-project', '../test-project' );

E-mail Aliases

Sometimes, a user will add to a repository with different e-mail addresses. If you want to, you can change the aliases yourself. When you want to add commits made by user old@email.com to user new@email.com, you can do this. You can add as many as you want.

'emailAliases' => array( 'user_old@email.com' => 'user_new@email.com' );

Upgrade From 0.3 To 0.4

Some changes have been made to the application since 0.4. It now runs on the Laravel framework, and there have been some changes. All you have to do is move your config.php to app/config/local/git-pretty-stats.php if you already have one. You don't have to follow the installation steps again.

If there is a specific graph or statistic that you are looking for but don't see, please let us know. It's time to make a request!

Share: Twitter|Facebook|Linkedin

Featured Articles

Recent Articles