r-git is an executable gem that assists with managing multiple git repositories. The current functionality allows you to perform the following actions on multiple repositories at once:
- View the status
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!
Install it yourself as:
$ gem install r-git
r-git is an executable gem with the following CLI options.
USAGE: rgit [global options] COMMAND [command options] GLOBAL OPTIONS: -v Run verbosely COMMANDS: add-root [PATH] Add a root directory (defaults to pwd). remove-root [PATH] Remove a root directory (defaults to pwd). show-roots Show roots. pull Git pull fetch Git fetch checkout BRANCH Git checkout status Git status -h, --help Show this message version Show version
See the main description for examples of how to use r-git
After checking out the repo, run
bin/setup to install dependencies. Then, run
rake spec to run the tests. You can also run
bin/console for an interactive prompt that will allow you to experiment.
rubocop can be run to inspec code style.
To install this gem onto your local machine, run
bundle exec rake install.
To release a new version, update the version number in
version.rb, and then run
bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the
.gem file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/jamesridgway/r-git.
The gem is available as open source under the terms of the MIT License.