dirty-repos: lists repositories with uncommitted work
A shell script that lists git repositories under the folders you name when they have modified, staged or untracked files. For anyone about to clean, sync or wipe a working tree.
About it
Work that exists only in a working tree is lost by a clean, a sync or a wipe. dirty-repos lists git repositories under the folders you name when they have modified, staged or untracked files, with a count and a total. It writes nothing into the folders it scans, takes no index lock, and does not start git's file monitor. The default search depth is 6. Limits: It does not report stashes, ignored files or commits never sent to a remote, so a repository that holds only those gets no line. It needs a POSIX shell (sh, bash, zsh or dash) and git 2.15 or newer, and there is nothing to install. A repository deeper than the depth limit, a bare repository, and one inside a folder it cannot read are not scanned. An inner repository can add one to its parent's count, and a modified submodule is counted in the parent and listed on its own. Git reads each repository's config and attributes, so a program named there is run by git as you. Door 54 of 100 Doors.