Note that there are some explanatory texts on larger screens.

plurals
  1. POgit submodule svn external
    primarykey
    data
    text
    <p>Let's say I have 3 git repositories, each with a <code>lib</code> and <code>tests</code> folder in the root. All 3 repositories are part of what I want to be a single package, however it is important to me to keep the repositories separate.</p> <p>I am new to git coming from svn, so I have been reading up on <code>submodules</code> and how they differ from <code>svn:externals</code>. In SVN I could have a single</p> <pre><code>lib/vendor/package </code></pre> <p>directory, and inside <code>package</code> I could setup 3 externals pointing to each of my 3 repositories <code>lib</code> directory, renaming it appropriately like</p> <pre><code>lib/vendor/package/a -&gt; repo1/lib lib/vendor/package/b -&gt; repo2/lib lib/vendor/package/c -&gt; repo3/lib </code></pre> <p>but from my understanding this is not possible with git. Am I missing something?</p> <p>Really I'm hoping this can be solved in one of two ways.</p> <ol> <li>Someone will point out how to create a 4th git repository which has the other 3 as submodules organized as I have mentioned above (where I can have an <code>a</code>, <code>b</code>, and <code>c</code> folder inside the root)</li> <li>Someone will point out how to set this up using <code>svn:externals</code> in combination with githubs svn support, referencing the <code>lib</code> directory within each git repository (from my understanding this is impossible)</li> </ol> <h3>Update:</h3> <p>I had actually tried to follow the submodules tutorial you linked to, but I run into the following problem.</p> <p>Doing things as shown above, instead of a mapping like</p> <pre><code>lib/vendor/package/a -&gt; repo1/lib lib/vendor/package/b -&gt; repo2/lib lib/vendor/package/c -&gt; repo3/lib </code></pre> <p>I am left with</p> <pre><code>lib/vendor/package/a -&gt; repo1 lib/vendor/package/b -&gt; repo2 lib/vendor/package/c -&gt; repo3 </code></pre> <p>this is not ideal since now to access <code>ClassA</code> inside <code>repo1</code>'s <code>lib</code> folder, the path is</p> <pre><code>lib/vendor/package/a/lib/ClassA </code></pre> <p>when I'm really trying to get (and this is possible with svn:externals)</p> <pre><code>lib/vendor/package/a/ClassA </code></pre> <p>since <code>a</code> above is actually <code>repo1/lib</code>, and not the root directory of <code>repo1</code>.</p> <p>Something like this is important since, with <code>PHP5.3</code> for example, using the <code>SplClassLoader</code> ( <a href="http://gist.github.com/221634" rel="nofollow noreferrer">http://gist.github.com/221634</a> ), it requires a namespace-to-directory mapping like</p> <pre><code>\Package\a\ClassA -&gt; lib/vendor/package/a/ClassA </code></pre> <p>this is where my conceptual misunderstanding is, how to setup that 4th git repository to allow my directory mappings like above.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload