I’m currently moving from symfony 1.4 using SVN to Symfony2 using Git. I am new to Git and have read a lot of documentation since a week but, unfortunately, I am unable to find a way to work as I worked before with SVN. Indeed, I understood that the approach is different between these two SCM.
Let explain how I worked with sf1.4 and SVN. My repository structure was like this :
root /* Main repository */
branches
tags
trunk
apps
backend
frontend
cache
[...]
lib
[...]
vendor
symfony /* SVN external to symfony sources */
log
plugins
sfThemePlugin /* SVN external to sfThemePlugin */
xxMyPlugin /* SVN external to a plugin repository I develop */
test
web
In this way, I was able to :
- Load an entire project in my favorite IDE with vendors, plugins and my own plugins
- Able to update symfony, plugins and other vendors from their respective repositories
- Work on my own plugins and commit them without switching of project
Now I would like to do the same with a Symfony2 project and Git. The problems are :
- The Sf2 Git repository contains a ‘src’ and a ‘test’ folder in its root so my project repository cannot include the Sf2 sources as I did with sf1.4 without generating conflicts if I add some files in ‘src’ and/or ‘test’ to my project or want to update the sf2 sources.
- I would like my bundles to have their own repositories and be able to work on them, switch of branches, commit and push/pull without having to switch of project, commit and push the bundles source independently and then update my main project submodules.
What would be the best approach to do this ?
I think there is a confusion.
As you are talking about a src and a test folder, I guess that you are using this repo : https://github.com/symfony/symfony and not the “standard” edition. In this situation, don’t put the content in your repository root but in the vendor/symfony folder.
So you will get the structure you want by managing bundles and vendors through submodules.