aaossa / git-activity

Display an activity graph (like the contribution graph on GitHub) for the current git repository and branch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git-activity

A custom git command to display an activity graph (like the contribution graph on GitHub) for the current git repository and branch. To add this custom git command to git, just place the file in a folder that's in your path (a.k.a PATH). You can setup git-activity as custom command.

Usage

# Display activity for this branch
$ git activity -h
Usage: git-activity [-h] [-n] [-s style]

Display an activity graph (like the contribution graph on GitHub) for the
current git repository and branch

Available options:

-h, --help      Print this help and exit
-n, --no-space  Remove spaces between week columns
-s, --style     Sets style of the graph: square (default), block, or plus

The output of the command displays a colored graph similar to the one that you can find in any GitHub profile webpage:

# And... a sample output (of course, does not contain colors)
$ git activity
        Jun     Jul     Aug       Sep     Oct     Nov       Dec     Jan       Feb     Mar     Apr     May     
    ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 
Mon ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
    ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 
Wed ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 
    ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
Fri ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
    ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■

 Less ■ ■ ■ ■ ■ More

image

There are also a couple of different styles available (square, block, and plus), and spacing between columns can be disabled:

# Another example to highlay some of the available options
$ git activity --no-space --style block
      Jun Jul Aug  Sep Oct Nov  Dec Jan  Feb Mar Apr May 
    █████████████████████████████████████████████████████
Mon █████████████████████████████████████████████████████
    █████████████████████████████████████████████████████
Wed ████████████████████████████████████████████████████
    ████████████████████████████████████████████████████
Fri ████████████████████████████████████████████████████
    ████████████████████████████████████████████████████

 Less █ █ █ █ █ More

image

Run On Mac

You need to install coreutils. If you have brew available, you can execute the command brew install coreutils.

License

This software is released under the MIT License

About

Display an activity graph (like the contribution graph on GitHub) for the current git repository and branch

License:MIT License


Languages

Language:Shell 100.0%