Using git with multiple repositories
Hi,
I'm working on a project that has organized parts of its website into entire "mini applications" that are stored in the /vendor/plugins directory of the main application - let's call it "main".
For example, main/vendor/plugins/app_a is a full-fledged Rails app in the sense that it has an app/controllers, app/helpers, app/views, config, db, lib, etc. directories. Being a complete, "mini app" It also has its own /vendor/plugins directory.
Similarly, there is a main/vendor/plugins/app_b, and app_c, etc.
Each of these mini-apps has its own git repository from which to push and pull changes, i.e. there is a .git directory containing git information for the mini-app. For example, this would be the entry that app_a has in its .git/config file:
[remote "origin"]
url = ssh://abc-dev/var/git/plugins/app_a.git
fetch = +refs/heads/*:refs/remotes/origin/*
Similarly, app_b and app_c would have something like the following in each of their own .git/config files:
[remote "origin"]
url = ssh://abc-dev/var/git/plugins/app_b.git
fetch = +refs/heads/*:refs/remotes/origin/*
- AND -
[remote "origin"]
url = ssh://abc-dev/var/git/plugins/app_c.git
fetch = +refs/heads/*:refs/remotes/origin/*
They set this up manually from the command line (they're Mac guys), so on my Linux laptop I have a "main" app with its own .git directory that contains "/vendor/plugins/app_a" with its own .git directory, and "/vendor/plugins/app_b" with its own .git directory, and "/vendor/plugins/app_c" with its own .git directory, etc.
Here is my question: How can I set up RubyMine so that it works with these different git repositories? For example, if I make changes within the "app_a" application I'd like to be able to push those changes to the "app_a" repository. And when I want to pull changes into the "app_b" application I'd like to be able to fetch those changes from the corresponding "app_b" repository.
This is the first time I have seen a project organized like this, but am told it is a pretty standard way, therefore I'm hoping there's a way to specify the correct plumbing within RubyMine.
Thanks,
Larry
Please sign in to leave a comment.
Hello Larry,

Yes it is possible. Just setup several git vcs roots in RubyMine | File | Settings | Version Control.
* Pull from all repos - Version Control | Update Project
* Select and push all commits in all repos - Version Control | VCS Quick List... | Push Active Branches..
* Commit - Version Control | VCS Quick List... | Commit Changes/File
* Checkout branch, stash, unstash, etc. commands (Version Control | VCS Quick List... or Version Control | Git | ...) usually suggest to choose git root
P.S: We highly recommend you to remember "Version Control | VCS Quick List.." and "Version Control | Update Project" shortcuts. This two actions provide access to all popular git commands.
Thanks a lot, Roman. And thanks for the heads-up about those two shortcuts!
BTW, I've said it before and I'll say it again: What an unbelievable piece of software!
Thanks,
Larry