Symfony + Git

First of all I recommend creating the project folder and also the lib/vendor/symfony folder
Second of all make sure you issue the following commands
[code]
cd ~/symfony-project/lib/vendor
git init
git add .
git commit
[/code]

[code]
cd ~/symfony-project
git init
git add .
git commit
git remote add origin .
git submodule add ./lib/vendor/symfony lib/vendor/symfony
git add .
git commit
[/code]

You should be set for your symfony projects

7 thoughts on “Symfony + Git

  1. [code]
    cordoval@cordoval-laptop:~/symfony-projects/sfproject$ git log
    commit 7c576be0f8f67815dc7493db1cb29881d0209c04
    Author: cordoval <cordoval@cordoval-laptop.(none)>
    Date: Mon Oct 18 02:02:35 2010 -0500

    generated frontend app

    commit eafc139f21f9b66d1d9c604d8df02aa56931d0ac
    Author: cordoval <cordoval@cordoval-laptop.(none)>
    Date: Mon Oct 18 01:57:04 2010 -0500

    generate symfony project sf1

    commit 2f346c239feec0e348238bcee59cc6062c3ad800
    Author: cordoval <cordoval@cordoval-laptop.(none)>
    Date: Mon Oct 18 01:46:06 2010 -0500

    adding submodule symfony 1.4

    [/code]

  2. [code]
    git rm config/databases.yml
    git rm –ignore-unmatch cache/*
    git rm –ignore-unmatch log/*
    [/code]

    [code]
    echo "config/databases.yml" > .gitignore
    echo "cache/*" >> .gitignore
    echo "log/*" >> .gitignore

    git status
    git commit -m "fixed problem for not using .gitignore initially"
    [/code]

    This guy here did it beautifully, but since I am learning git I went for the manual mode
    http://www.nacho-martin.com/automating-the-creation-of-new-symfony-1-4-projects-doctrine-git

    I want to learn and that is why I like to type everything by hand almost. Thanks for pushing me to be more thorough

  3. With RubyOnRails you create a new project with the following:
    [code]
    rails new myapp
    [/code]

    This will automatically create a .gitignore file:
    [code]
    ../myapp$ more .gitignore
    .bundle
    db/*.sqlite3
    log/*.log
    tmp/**/*
    [/code]

    Maybe you can hardwire something into the symphony startup script?

Leave a Reply

Your email address will not be published. Required fields are marked *