git-global to keep track of all the git repositories on your machine.
This is a Rust program that you can install with
cargo install git-global. (To obtain
cargo and Rust, see https://rustup.rs.) Once installed, you gain an extra git subcommand that you can run from anywhere to check up on all your git repos:
git global <subcommand> to:
git global info: show meta-information about git-global itself (configuration, number of known repos, etc.)
git global list: show list of all known repos
git global scan: update the cache of known repos by searching your filesystem
git global staged: show status of the git index for repos with such changes
git global stashed: show stashes for all repos that have them
git global status: show
git status -sfor all your repos with any changes
git global unstaged: show status of the working directory for repos with such changes
In addition to config-file-based options, there are a set of global command-line flags that take precedence:
--json: Print subcommand results in a JSON format.
--untracked: Show untracked files in subcommand results, e.g., for the
--nountracked: Don't show untracked files in subcommand results, e.g., for the
To change the default behavior of
git-global, you can do so with --- wait for it --- git's global configuration!
To set the root directory for repo discovery to something other than your home directory:
git config --global global.basedir /some/path
To add patterns to exclude while walking directories:
git config --global global.ignore .cargo,.vim,Library
The full list of configuration options supported in the
global section of
basedir: The root directory for repo discovery (default:
follow-symlinks: Whether to follow symbolic links during repo discovery (default:
same-filesystem: Whether to stay on the same filesystem as
basedirduring repo discovery (on Unix or Windows only) (default:
trueon Windows or Unix,
ignore: Comma-separated list of patterns to exclude while walking directories (default: none)
default-cmd: The default subcommand to run if unspecified, i.e., when running
show-untracked: Whether to include untracked files in output (default:
The following are some ideas I've had about future subcommands and features:
git global dirty: show all repos that have changes of any kind
git global branched: show all repos not on
master(TODO: or a different default branch in .gitconfig)
git global duplicates: show repos that are checked out to multiple places
git global remotes: show all remotes (TODO: why? maybe filter by hostname?)
git global add <path>: add a git repo to the cache that would not be found in a scan
git global ignore <path>: ignore a git repo and remove it from the cache
git global ignored: show which git repos are currently being ignored
git global monitor: launch a daemon to watch git dirs with inotify
git global pull: pull down changes from default tracking branch for clean repos
stream results to
STDOUTas the come in (from
git global status, for example, so we don't have to wait until they're all collected)
locate .gitif the DB is populated, instead of walking the filesystem
do concurrency generically, not just for the
- 0.3.1 (2020-04-25)
- Update dependencies.
- 0.3.0 (2019-08-04)
- Add subcommands:
- Add config options:
- Add command-line flags:
- Add options to follow symlinks and stay on the same filesystem while scanning directories; both are
trueby default. (Thanks, pka!)
- Add subcommands:
- 0.2.0 (2019-03-18)
- Include untracked files in status output.
- Expand documentation and package metadata.
- Update and change several dependencies.
- Add some tests.
- Several public API changes, such as:
- Split the
- Merge bug fix for scanning directories when nothing is configured to be ignored (#1).
- 0.1.0 (2017-01-31)
- Initial release with these subcommands: help, info, list, scan, status.