Using git to manage your Symfony Standard Edition version
One way to use the Symfony Standard Edition is to download the package, unpack it and start coding. When there is a version update you have to download the updated package and merge the changes into your project manually. It is always well-documented which changes have to be made so this shouldn’t be too tricky.
However there is a more convenient way to keep your project up-to-date. (At least in my eyes.) You can use git to do these updates. All you have to do is to setup the github repository of the Symfony Standard Edition here as a remote repository of your project.
So in order to start a new project I would do the following:
$ cd /path/to/my/project $ git init .
To add the Symfony repository as a remote repository type:
$ git remote add symfony git://github.com/symfony/symfony-standard.git
The next step is to fetch the contents of the repository:
$ git fetch symfony
You can now see that you have the remote branches and tags in your local repository:
$ git branch -r symfony/2.0 symfony/master $ git tag v2.0.0 v2.0.0-RC1 ... v2.0.0PR9 v2.0.1
Next you can checkout the branch into which you want to merge a certain Symfony version and execute the merge:
$ git checkout master $ git merge v2.0.0-PR12
The PR12 version of the Symfony Standard Edition has been merged to your master branch now.
Let’s simulate how an update would be done. You can create a file called “deps” and write something to it. Then commit this change to the current branch:
$ echo "Some silly content" > deps $ git add . $ git commit -m "Some silly commit" [master 365eee9] Some silly commit 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 deps
Also you can modify the app/config/parameters.ini and set a dummy database user and password:
$ vi app/config/parameters.ini [ ... ] $ git add . $ git commit -m "parameters.ini changed" [master 0d8a665] parameters.ini changed 1 files changed, 2 insertions(+), 2 deletions(-)
The next step is to bring the project to version 2.0.1 of Symfony:
$ git fetch symfony$ git merge v2.0.1Removing VERSION
Removing app/cache/.gitkeep
Auto-merging app/config/parameters.ini
Removing bin/build.shRemoving bin/build_bootstrap.phpRemoving bin/vendors.shAuto-merging deps
CONFLICT (add/add): Merge conflict in deps
Removing src/Acme/DemoBundle/Form/ContactForm.php
Automatic merge failed; fix conflicts and then commit the result.
As you can see your changes to the parameters.ini have been merged automatically without any problems (5). However git could not merge the file “deps” (9-10) intelligently with the recent version and therefore asks you to solve the conflicts manually (12).
The point is that git shows you which files need your attention and you don’t forget any update advice given by the official release notes. Therefore I think this way is safer than updating your project manually.
The last step in the update process is to update the vendors and clear the (production) cache:
$ bin/vendors install $ app/console cache:clear --env dev $ app/console cache:clear --env prod
I hope this post could give you some inspiration for version management with Symfony and the usage of git in general.

Ruben de Vries 05 Sep 2011 | 12:06
I used this aproach a while back and I noticed that if I didn’t delete my local repo afterwards and recreated it withouth fetching the remote that doing ‘git push –tags’ would also push the symfony tags into my list of tags … do you have the same problem or am I doing something wrong?