EntropySink

Technical & Scientific => Programming => Topic started by: micah on July 30, 2014, 12:03:01 PM

Title: Source control inside of source control
Post by: micah on July 30, 2014, 12:03:01 PM
This is an SVN and/or GIT question.

I have several projects that I use git to manage that are hosted on my website.  eg  domain.com/code/project1 or domain.com/code/project2 each being its own repository.

I now want to manage my entire site (domain.com) with git as well but it already includes a bunch of repositories.  Any ideas on best practice for this?  Should I just ad an ignore command for the existing repositories?
Title: Re: Source control inside of source control
Post by: Mike on July 30, 2014, 01:19:32 PM
With git you can add submodules.  So each project has a repo and then the domain has a repo with each project as a submodule.
Title: Re: Source control inside of source control
Post by: micah on July 31, 2014, 08:59:38 AM
oh nice! I'll start googling the best way to do that. Thanks!
Title: Re: Source control inside of source control
Post by: hans on July 31, 2014, 10:27:59 AM
I'm not a huge fan of submodules in git. Depending on how you use them you can really mess up your repository. If they aren't changing all of the time and don't have any cross dependencies that's usually OK, but if you're changing them frequently (at the same time) managing the versions in the parent can be a pain.

I might actually prefer to keep things in separate projects and simply use a build tool to package them together.
Title: Re: Source control inside of source control
Post by: Mike on August 02, 2014, 03:54:21 PM
Random idea: look to see if you can't make the individual repos composer dependencies of the big repo
Title: Re: Source control inside of source control
Post by: micah on June 09, 2015, 01:40:10 PM
Ok, revisiting this question, but in a different context.

I used git to install something off github. Now I want to create a plugin for it which should have its own repository.  I don't want to fork the whole project but the code for my plugin is living inside the bigger project.  What's the best practice for this?
 
Title: Re: Source control inside of source control
Post by: hans on June 09, 2015, 09:02:03 PM
submodule or symlink, although forking is really not that big of a deal.