Tito Miguel Costa
Refactoring ideas

How to version a Symfony2 project with git

Step by step to use git in a Symfony2 project

  1. at the root of the Symfony2 project create a file named .gitignore, this file will contain entries to be ignored by git
  2. add to the .gitignore the following entries:
    • /web/bundles/
    • /app/bootstrap*
    • /app/cache/*
    • /app/logs/*
    • /vendor/
    • /app/config/parameters.ini
  3. initialize the git repository:
    $ git init
  4. add all the project files but the ones in the .gitignore file
    $ git add .
  5. create an initial commit
    $ git commit -m "initial commit"
  6. To publish the project to GitHub, follow the official tutorial
4 September, 2011
Symfony2, Git