Use 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
.
Use git global <subcommand>
to:
git global [status]
: show git status -s
for all your git repos (the
default subcommand)git global info
: show information about git-global itself (configuration,
number of known repos, etc.)git global list
: show all git repos that git-global knows aboutgit global scan
: search your filesystem for git repos and update the cacheTo change the 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 following are some ideas I've had about future subcommands and features:
git global unstaged
: show all repos that have unstaged changesgit global staged
: show all repos that have staged changesgit global stashed
: show all repos that have stashed changesgit global dirty
: show all repos that have changes of any kindgit 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 placesgit 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 cachegit global ignored
: show which git repos are currently being ignoredgit global monitor
: launch a daemon to watch git dirs with inotifygit global pull
: pull down changes from default tracking branch for clean repos
stream results to STDOUT
as the come in (from git global status
, for
example, so we don't have to wait until they're all collected)
locate .git
if the DB is populated, instead of walking the filesystemSubcommand
traitstatus
subcommandGitGlobalConfig
to Config
.GitGlobalResult
to Report
.get_repos
find_repos
, and cache_repos
functions to Config
.core
module into config
, repo
, and report
.