Master Symfony2 fundamentals

Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).

Discover the SensioLabs Support

Access to the SensioLabs Competency Center for an exclusive and tailor-made support on Symfony

Fabien Potencier
Symfony 2 Migration to Git
by Fabien Potencier – January 13, 2010 – 14 comments

As you might have noticed if you follow me on Twitter (which you should do as I make a lot of small announcements there), or if you monitor the Subversion activity closely, the Symfony 2 code is now hosted on Git.

First of all, let's make it clear right from the start:

The symfony 1.x branches won't be migrated to Git, ever. This post is only talking about Symfony 2, which is obviously not yet released.

So, from now on, all the development activity for Symfony 2 will take place on the new Git repository.

What is Git?

Git is a free distributed revision control system. As explained on Wikipedia, Git was initially designed and developed by Linus Torvalds for Linux kernel development.

Since then, Git has been embraced by a lot of big projects like Ruby on Rails; and recently more and more PHP projects have also made the switch (like PHPUnit or CakePHP for instance).

Apart from being fast as hell, it is also a brand new way of thinking and coding. Being distributed means that when you get a copy of a project (a "clone" in Git speak), you retrieve locally a full-fledged repository with complete history. It allows you to easily work offline for instance.

The other big advantage of Git for a project like Symfony is the ease of accepting contribution from our users. Instead of submitting patches (which you can also do), you can "fork" the project, do some work and ask a member of the core team to "pull" your work. It dramatically lowers the barrier of entry for contributing to the Symfony core. You can also easily maintain your own version of Symfony, and merge the changes easily from the master branch (easy branching and merging is yet another big advantage of Git compared to Subversion).

Symfony on Git

Git being distributed by nature, there is no need for a central repository. That being said, we host an official Git repository on Github. Nowadays, Github is probably the easiest way to participate in the collaboration loop. Everything can be done from their website with some clicks of the mouse (from forking the code to request a pull).

You can also fork one of the core team member repository, like mine, if you want to live on the edge.

Learn to love Git

Many people think that Git is too hard to understand and learn. That's not really true. Of course, you need some help to get started and more important to grasp the main concepts behind Git.

But even if finding documentation on the Internet about Git is not that difficult, it's very difficult to find good tutorials for beginners. I was learning Git the hard way, being frustrated more than once, until I read the excellent Pro Git book by Scott Chacon. This book is the best documentation I have ever read on Git and teach you everything you need to know to master Git in a matter of hours. You can buy the printed book or read it online for free as it is released under the GFDL license!

The Subversion Mirror

Last but not the least, if you don't want to switch to Git or if you cannot afford it because of some corporate policy, be reassured, we won't abandon you. As a user of Symfony, you can still use Subversion as the main Git repository is mirrored on the Symfony Subversion repository as well under the 2.0 branch.

Comments RSS

  • gravatar
    #1 Pablo Godel said on the 2010/01/13 at 16:07
    I think this is the right move.

    When I started with git a couple of years now, I found this guide very useful as I came from subversion:
  • gravatar
    #2 Gabriel said on the 2010/01/13 at 16:23
    Great to see you move over to GIT.
    It's definitely the way to go for future projects.
  • gravatar
    #3 Peter said on the 2010/01/13 at 16:50
    What I don't get about Git is... how do we handle svn:externals, the current preferred way to load/pull in plugins?
  • gravatar
    #4 Jamie said on the 2010/01/13 at 17:08
    Git is great on my linux and mac dev machines. But using Git on windows is absolutely awful. There is no decent Git application for windows like there is for SVN, such as Subversive(for eclipse) and Tortoise SVN.

    This is why I am hesitant to switch to Git. Alas.
  • gravatar
    #5 goofy said on the 2010/01/13 at 17:38
    It would be cool if an expert could make a solid tutorial to use GIT with symfony 1.4 and plugins …
  • gravatar
    #6 Fabian Lange said on the 2010/01/13 at 18:02
    There is no need for a tutorial for symfony 1.4 and GIT. Symfony 1.4 will not be GIT at all.
    For Symfony 2, there will be a way to install plugins, but it will most likely not be the same as in symfony 1.x to address serveral shortcomings.
    There will be then a good procedure for that.
  • gravatar
    #7 Mario Rezende said on the 2010/01/13 at 19:16
    Hi Fabien. When you intend to release Symfony 2.0?
  • gravatar
    #8 Marijn Huizendveld said on the 2010/01/13 at 22:55
    Just for clarity, the online version of the Pro Git book can be found on the Pro Git website:

    Nice move btw, contributing with git is so much easier:)
  • gravatar
    #9 Luís Sousa said on the 2010/01/13 at 23:33
    On windows it can be used

    We have been usign for 2 years and works fine
  • gravatar
    #10 Olivier Poitrey said on the 2010/01/14 at 01:20
    Congrat, you finally did it! ;)
  • gravatar
    #11 Freezing said on the 2010/01/14 at 12:10
    #3: gitmodules are equivalent of svn:externals. they're not automatically initialized during clone/pull because their usage is slightly different.
  • gravatar
    #12 Matt Robinson said on the 2010/01/19 at 15:14
    I'm with @peter. Installing Symfony through svn:externals is a major point of our project development process. As long as there's no equivalent on Git, we'll be sticking with the SVN mirror. :/
  • gravatar
    #13 Fabien said on the 2010/01/19 at 15:46
    @All: as already said, the Git modules are roughly the equivalent to svn:externals. I say "roughly" because they do not work the same way. But of course we will take care this into account for the plugin system.
  • gravatar
    #14 Yujin said on the 2010/02/09 at 15:48
    Like to see symfony moved to git. I found symfony when browsing github. In fact i am still in beginning, searching symfony vs zend.