Find out why you didn't sleep – a Git commit timeline analyzer
Gitnapped is a command-line tool that analyzes your Git commit history across multiple repositories. It provides insights into your coding patterns, helping you understand where your time is spent across projects.
Picture this: it's 5 PM, you're ready to call it a day, but then you think, "Just one more commit…" Next thing you know, it's 2 AM, and you're knee-deep in code. That's being gitnapped! Gitnapped (the tool) helps you spot these moments by analyzing your commit history—showing you when Git's magic stole your sleep.
So, have you gitnapped yourself lately?
- Analyze commits across multiple repositories
- Group repositories by categories or projects
- Filter by time periods (relative or absolute dates)
- Filter by author
- View detailed statistics including:
- Commit counts
- Files changed
- Lines added/removed
- Most active days
- File types modified
cargo install gitnappedbrew tap Solexma/gitnapped
brew install gitnappedgit clone https://github.com/Solexma/gitnapped.git
cd gitnapped
cargo build --releaseThe compiled binary will be available at target/release/gitnapped.
gitnapped [OPTIONS]# Analyze commits from yesterday to now
gitnapped
# Analyze commits from the last 6 months
gitnapped -p 6M
# Analyze all repositories with detailed information
gitnapped --repo-details
# Show only active repositories grouped by project
gitnapped --active-only --projects
# Analyze a specific directory without a config file
gitnapped -d /path/to/repositoryGitnapped can be configured in two ways:
-
Using a Config File Create a
gitnapped.yamlfile in your working directory or specify a custom path with-c:author: "Your Name" repos: personal: - /path/to/repo1 [Category][Project Name] - /path/to/repo2 [Category][Project Name] clients: - /path/to/client1 [Client][Project Name] opensource: - /path/to/opensource1 [OSS][Project Name]
-
Using Current Directory If no config file is found, Gitnapped will automatically use the current directory as a repository. This is useful for quick analysis of a single repository without creating a config file.
Note: The current directory must be a valid Git repository for this fallback to work.
- If no config file is specified (
-c), Gitnapped will look forgitnapped.yamlin the current directory - If no config file is found, it will use the current directory as a repository
- If a directory is explicitly specified with
-d, it will only analyze that directory - The author name in the config file will be used to filter commits unless overridden by
-aor--all-authors
-c, --config <FILE> Sets a custom config file
-d, --dir <DIRECTORY> Sets a directory to analyze (bypasses config file)
-s, --since <DATE> Start date for analysis (YYYY-MM-DD)
-u, --until <DATE> End date for analysis (YYYY-MM-DD)
-p, --period <PERIOD> Relative time period (e.g., 6M, 2Y, 5D, 12H)
--active-only Show only repositories with commits in the period
--sort-by <FIELD> Sort repositories by: commits, files, lines (default: commits)
--categories Show statistics by category
--projects Group repositories by project name
--repo-details Show detailed information for each repository
--filetypes Show file types used in the repositories
-a, --author <AUTHOR> Filter commits by specific author
--all-authors Include commits from all authors
--most-active-day Show the most active day
--silent Silent mode, no output
--json Output in JSON format
--debug Enable debug messages
--working-time <TIME> Working hours in 24-hour (HH:MM-HH:MM) or 12-hour (HAM-PM) format (default: 09:00-17:00)
--ungitnapped Hide gitnapped information from the output
--most-active-repos <N> How many most active repositories to show (default: 5)
--show-total-stats Show total stats across all analyzed entities
--pretty Pretty print the outputLicensed under AGPL-3.0 license.
Let's be real.
Gitnapped is a fancy wrapper for Git's command-line magic. But that's the point! It takes the heavy lifting out of analyzing your commit history, so you can see when you've been gitnapped by your code—those late-night commit sprees or weekend coding binges. Understand your coding patterns, reclaim your sleep, and maybe have a laugh along the way.
Marco Orlandin marco@solexma.com