Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time

Go Reference BuildStatus Go Report Card TODOs codecov Twitter Follow

mergestat-lite MergeStat Logo

mergestat-lite is a command-line tool for running SQL queries on git repositories and related data sources. It's meant for ad-hoc querying of source-code on disk through a common interface (SQL), as an alternative to patching together various shell commands. It can execute queries that look like:

-- how many commits have been authored by
SELECT count(*) FROM commits WHERE author_email = ''

It installs a binary named mergestat.

More in-depth examples and documentation can be found on our dedicated documentation site.

Join our community on Slack if you have questions, or just to say hi πŸŽ‰.


See the full instructions in our documentation.


brew tap mergestat/mergestat
brew install mergestat


docker run -v "${PWD}:/repo" mergestat/mergestat "select count(*) from commits"


SQL queries can be executed in the CLI on local or remote git repositories. Remote repos are cloned to a temporary directory at runtime.

CLI SQL Screenshot

The --format flag can be used to output json, ndjson, csv and more (see mergestat -h). This can be useful for piping/using with other tools.

Higher level commands such as mergestat summarize commits generate reports without requiring a SQL input. Learn more here about the available flags such as --start to change the date range and --json to output as JSON.

CLI Summarize Commits Screenshot

Learn more in our docs