r-git is an executable gem for managing multiple git repositories within a single top level directory. Fetch, pull, change branch and status commands can be easily issued across all git repositories that reside within the top level directory.
Install it by running:
$ gem install r-git
How It Works
Imagine the scenario where you have several git projects under some parent:
└── personal-projects ├── arbitary-sub-folder │ ├── projectX (git repo) │ ├── projectY (git repo) └── r-git (git repo) └── work-projects ├── repo-one (git repo) └── repo-two (git repo)
r-git has the concepts of 'roots' in our scenario
work-projects are our roots. I register these by running the following from within each folder:
$ rgit add-root
Running any of the following commands will result in that command being executed across all projects within the root:
Status of all repositories
Execute git pull on all repositories
Execute git fetch on all repositories
rgit checkout development
git checkout developmenton all repositories
For example: executing rgit fetch from within any folder in personal-projects will run git fetch on all repositories in that folder/root.
It's that simple!