๐ฟ gitdrift v1.0.0 ยท MIT
Find out which local repos never got pushed โ dirty worktrees, unpushed commits, dead remotes โ with a cron-friendly exit code.
The problem
Backup scripts and nightly pushes fail silently. Days later you discover your local repository was 8 commits ahead of every remote โ and one of those days your disk dies. gitdrift answers one question across many repos at once: is anything local that should be somewhere else?
What it checks
- Dirty worktree โ modified or staged files never committed.
- Ahead/behind โ commits not yet pushed to (or pulled from) the upstream.
- Untracked files โ reported in detail, counted as drift only with
--strict. - Broken setups โ no remote configured, upstream branch missing on the remote, repository with no commits.
- Discovery โ point it at a root directory and it finds every repo (depth-limited, never descends into repos).
Install (pip)
pip install gitdrift @ git+https://mandrilly.com/git/gitdrift.git
Usage
gitdrift # discover repos under cwd (depth 2) gitdrift ~/work ~/code --depth 3 # discover under multiple roots gitdrift path/to/repo # explicit repos gitdrift --json # machine-readable report gitdrift --strict # untracked files also count as drift
Exit codes (cron-friendly): 0 clean ยท 1 drift found ยท 2 error. Zero third-party dependencies โ only git on PATH.
Tests
python -m unittest test_gitdrift -v