2

So we have a submodule:   App-Models/src/models/question.rb

And our main rails application is: App-Rails (which uses submodule App-Models)

cd App-Rails
git submodule add git@url:SC-Models app/models

This will create:

SC-App/app/models/src/models/question.rb

Seems like that sub-directory structure is really messy and too nested, how do we avoid it?

We would essentially like to have:

App-Models/src/models/question.rb

and App-Rails/app/models/question.rb (from submodule)

ps. We like App-Models to be in sub-directories so it is easier to test the files.

Kamilski81
  • 14,409
  • 33
  • 108
  • 161
  • Git does not track directories - only content, so unfortunately you can't do this. Simplest way to make your project have clean paths is to keep a submodule dir and have a symlink in App-Models/src/models/question.rb to the relevant file in the submodule. – pielgrzym Jul 20 '12 at 09:39
  • This is duplicate of http://stackoverflow.com/questions/5303496/how-to-change-a-git-submodule-to-point-to-a-subfolder For me the best solution was the one given by Adam Dymitruk, i.e. create a branch in the submodule's repository and move the folders up the way you want it. – dregad Sep 12 '12 at 16:57

0 Answers0