There is 1 main RoR project and 2 additional projects share some parts of main project – models, plugins, etc.
Currently all projects are under same svn repository with svn externals for shared parts.
What is best way of moving such layout to git?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will need a repository for each of the parts. (each project and one or more for the shared parts).
To include these shared parts there are two possibilities.
First the easy one, you create a (private) gem for the shared parts, that means you don’t need to link anything, just add gem [gemname] to your Gemfile. When you update the gem, all projects will use the changed code.
When you want to include the external code in your project you need a little bit of organisation. You create a root map where you clone both the shared and project repository to. Then you create a (relative) symlink, to the shared code folder. You can just add this symlink to your git repository and commit it. You have to update and commit both repositories seperate.
An example of the second method:
The link to shared code is created by the command ln -s “../../../shared code” shared
Ofcourse, this only works on systems supporting symbolic links (mac and *nix)