git-truck

Git Truck - visualize your repo

Git Truck allows you to get an understanding of how your repository is structured, where there has been the most activity at different points in time, and who worked on which parts of the codebase.

Local analysis of the .git folder

🔒 Git Truck analyzes your project history using the local .git folder. It runs completely locally, so your code stays on your machine and is never uploaded to the cloud.

How does it work?

For each file in your repository, Git Truck lets you map metrics onto it:

You can mix and match these metrics to answer different questions about your project. The examples below show a few questions Git Truck can help your team explore.

🕑 Where has the project been active recently?

Git Truck visualization showing recently changed files in npmx

Example from npmx.dev, a feature-rich alternative to npmjs.com.

👨‍💻 Are we overreliant on one developer?

Git Truck visualization showing top churners in Supabase

Example from Supabase, an open source Firebase alternative.

⚠️ Do some files have extreme levels of activity, indicating poor separation of concerns?

Git Truck visualization showing high line-change activity in Pandas

Example from Pandas

🛠️ Who is responsible for different subsystems?

Git Truck visualization showing authorship by subsystem in npmx

Example from npmx.dev, a feature-rich alternative to npmjs.com.

📂 What is the folder structure of a complex project?

Git Truck visualization showing the V8 repository folder structure

Example from V8

👨‍💻 Where and when have specific contributors worked?

In this example, we can see that during the selected time interval, the selected contributors mostly worked in isolated areas of the codebase. For example, Maja contributed prominently to the teacher folder. There is also some overlap, such as in i18n, which makes sense because internationalization is a cross-cutting concern.

Git Truck visualization showing selected contributor activity in zeeguu/web

Example from zeeguu/web

How to get started

The only requirements are:

To run Git Truck, navigate to a repository, or a folder containing multiple repositories, and run npx git-truck. This will run the latest version of Git Truck without installing it globally.

To install the latest version of Git Truck globally, run npm install -g git-truck@latest. You can then run Git Truck from any repository using:

git truck

To update it later, run:

npm install -g git-truck@latest