Skip to content

ScaryFrogg/git_contribution_graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

screenshot

Getting Started

Getting the binary

If you have go installed, you can build from source

go build -o gcg cmd/git_contribution_graph/main.go

Or download from releses page.

Github API access token

If you want to use github mode, you need to create new access token at https://github.com/settings/tokens, read:user scope is enough.

Dependencies

Only dependency needed is git.

Usage

Github Contributions Graph

gcg -token=$GH_CONTRIBUTION_KEY -username=ScaryFrogg

screenshot

By default graph shows current year from beggining until present time. If you want to specify period you can do that by providing from and to flags using ISO-8601 format.

gcg -token=$GH_CONTRIBUTION_KEY -username=ScaryFrogg -from=2023-01-01T00:00:00Z -to=2023-12-31T23:59:00Z 

screenshot

NOTE: GitHub API doesn't accept period longer than 1 year.

Local Git reposetories

This is the default mode and you and it is activated when no tokem is provided. Options from and to are optional and work the same as in github mode.

To add gcg to run after you change directory in terminal and print if you are inside repo you can add something like this in your .bashrc or equivalent file for other shells:

function cd {
    builtin cd "$@" && gcg
}

Additional Options

  • colors : lets you provide custom colors for squares in the graph, format should be 5 ANSI 256 color codes separated by comma.
gcg -colors=1,230,11,157,10 -token=$GH_CONTRIBUTION_KEY -username=ScaryFrogg -from=2024-05-23T00:00:00Z 

customColors

  • legend : by default set to true if set to false will remove months and weekdays from output
gcg -legend=false -token=$$GH_CONTRIBUTION_KEY -username=ScaryFrogg -from=2024-05-23T00:00:00Z 

noLegend screenshot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published