Yii project with git and svn modules

Hi!

First of all, I would like to thank you, Yii guys, for Yii. :)

I’m newbie to Yii and Git and trying to figure out the best practice for a project consisting of multiple extensions / modules hosted on remote git / svn repos.

What I want to achieve is one Git repo that includes all the base code & ext & submodules either from remote Git or SVN with ability to push it to our main git repo, share it with other devs and update/sync all remote repos.

The solution should be supported by Eclipse end eGit but since eGit doesn’t support submodules, I believe we will have to use some other git client or cmd line.

Currently I have two ideas to solve my problem:

using git submodules: put all remote repositories under main Git tree (ie: under /protected/extensions/… or even in separate dir like /protected/git/…).

all code will be in one place and easily shareable / updatable among devs. Use of cmd line or some other, more capable git client than eGit is a must.

by putting all remote repos out of the main Git tree, track them with eGit/SVN and symlinking needed parts to main git tree. The disadvantage in this approach is (as I see it) a need of multiple repositories that are hard to share between devs.

Well, maybe all my proposed solutions are completely wrong and I should take completely different approach. As I said, I have almost no experience with git.

So please, share your experience with yii, git, svn, eclipse & other editors & IDEs, remote repos, multiple repos, submodules, … anything that could ease the management of new (or old) project.

Many years I spent with TYPO3 (it’s CMS, not a framework) and I just can’t wait to start coding with Yii.

Thanks,

Tomi

Anybody? Well, obviously not.

So let me post some findings on this issue. I really don’t know if this is the way to go, but for now it looks like it suits our needs.

First we created a root folder that holds a structure suggested in wiki http://www.yiiframework.com/wiki/116/how-to-set-up-directory-structures-for-multiple-yii-project-support ie. moved protected and runtime out of wwwroot.

This folder became our main git repo for the project. In this folder we added two more folders called svn and git (so we can easily distinguish remote repositories). In this subfolders we created independent repos (not submodules) for all extensions and modules that are needed for our project and then created symlinks to appropriate locations under protected folder.

The folder structure looks like this:

  • main project (.git main repo)

– wwwroot

– protected

—modules

----user (sym link to svn/yii-user-management/user)

– framework (sym link to git/yii/framework)

– runtime

– svn

— yii-user-management (.git repo using git-svn)

– git

— yii framework (.git repo from github)

We are using git for all the communication with remote repos (git and svn).

We also decided that currently there is no need for all developers to update extensions and modules from external repos so this is done from one computer only.

This way we have all the code under one git repo wich is pushed to main git server from where it can be pulled by other developers and/or published directly to web.

I hope this will help to raise some debate or just give some info on how others are abusing git & yii. As I said: this is by no means a howto or a guide or such…

regards,

T.

In my Subversion projects I’m currently using the following scheme:

/repository/

/repository/application/ (protected folder)

/repository/application/extensions/ (has svn:external properties set to different extensions)

/repository/runtime/

/repository/www/ (webroot containing index.php and assets)

Repository is implemented according to common trunk/ branches/ tags/ structure.

I have not included yii (as an external) in my repository.