Skip to content
项目

关于

A beautiful terminal UI for visualizing Git repository statistics, inspired by htop/btop.

科学与工程

这些数字如何统计

162 星标4 复刻 +2 24小时

实测星标增长

24小时
+2
7天
+2
15天
+1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

GitTop

A beautiful terminal UI for visualizing Git repository statistics, inspired by htop/btop.

Go

Summary — KPI cards and commit activity chart

Prototyped rapidly with an agentic coding tool. Read the blog post.

Install

Arch Linux (AUR)

yay -S gittop-tui-bin

Homebrew

brew install hjr265/gittop/gittop

Go

go install github.com/hjr265/gittop@latest

Or build from source:

git clone https://github.com/hjr265/gittop.git
cd gittop
go build -o gittop .

Usage

gittop               # visualize the current directory's Git repo
gittop /path/to/repo
gittop --range all   # start with the full history instead of the last year
gittop --version     # print the version
gittop --help        # list flags

Flags go before the path. --range takes 3m, 6m, 1y, 2y, 5y, or all. To change the starting range for every run, set default_range in GitTop's config file (~/.config/gittop/config.toml on Linux):

default_range = "all"

When no path is given, GitTop also respects the GIT_DIR and GIT_WORK_TREE environment variables.

Tabs

# Tab What it shows
1 Summary KPI cards (total commits, active days, peak day, time span, latest release) + area chart (braille or block)
2 Activity Heatmap, by-hour, by-weekday, by-month distributions
3 Contributors Split panel: ranked list (left) + per-author detail with cadence, schedule, top files (right)
4 Branches Sortable table with last commit, author, ahead/behind counts
5 Files Largest files, most churn, most authors, stalest files, language breakdown
6 Releases Tag timeline and release cadence chart
7 Commits Scrollable commit log with diff viewer and search

Screenshots

Activity — By Hour Activity — Filtered by author
Contributors — Author detail Files — Language breakdown
Releases — Tag timeline Commits — Log

Keys

Key Action
1–7 Switch tab
Tab / Shift+Tab Next / previous tab
+ / - Widen / narrow date range (3m, 6m, 1y, 2y, 5y, all)
/ Open global filter (author:"name", path:*.go, branch:main, "keyword", and/or/not)
Esc Clear filter or page-local search
r Refresh (re-scan repository)
d / w / m / y Chart granularity: daily, weekly, monthly, yearly (Summary)
v Cycle sub-views (Activity, Contributors, Files, Releases)
f File path filter (Files tab)
s / S Sort column / toggle order (Branches); search (Commits)
j / k Scroll down / up
PgDn / PgUp Scroll down / up one page
Ctrl+D / Ctrl+U Scroll down / up half a page
g / G or Home / End Jump to top / bottom
Enter Open commit diff (Commits)
o Open options menu (color theme, truecolor, graph symbol, mouse)
q Quit

The mouse wheel scrolls lists and the diff view. Clicking a tab switches to it, clicking a single-key entry in the bottom bar (such as o options) triggers it, and options in the options menu can be clicked to change them. While mouse support is on, hold Shift to select text in most terminals (Option in some macOS terminals). Turn it off in the options menu if you prefer plain selection.

Recommended Setup

For best results with the block character bar charts:

  • Terminal: Kitty, Alacritty, or WezTerm
  • Font: JetBrains Mono, Iosevka, or Fira Code

License

BSD 3-Clause License. See LICENSE for details.

探索相关项目

加载中…