Setting up GIT for Symfony2 project: why add web/bundles folder to gitignore

I am building my first Symfony2 project and I may be confused on the purpose of the web/bundles folder. According to Symfony2 documentation they say this is where static data goes like js libraries, css and images. This all makes sense but while you are still building that base layout isn’t it a little annoying to have /web/bundles on the ignore list? In fact why even have it on the ignore list? bootstrap, parameters, cache, etc all makes sense to have on ignore because you don’t want to cross development settings with production settings.

This is what symfony instructs you to add to the gitignore:

  • CruiseControl.Net with git build fails when running as a service
  • Can Git merge “use” the information found by git blame -C
  • I accidentally created a local branch named origin/foo. Now what?
  • Move git HEAD without changing anything else
  • Automated sync between Github and Kiln
  • Cannot git diff. File exists in both branches but getting “fatal: Path '…' exists on disk, but not in 'master'”?
  • /web/bundles/
    /app/bootstrap*
    /app/cache/*
    /app/logs/*
    /vendor/
    /app/config/parameters.yml
    

  • Git users in an SVN shop, organising our repos
  • Jenkins is throwing a hudson.util.IOException2 on a Windows 2008 Server
  • Get Git repo url using absolute path
  • How do I apply rejected hunks after fixing them?
  • How can I get Visual Studio to show merge conflicts under git?
  • Git Workflow Pull vs Fetch
  • 2 Solutions collect form web for “Setting up GIT for Symfony2 project: why add web/bundles folder to gitignore”

    The reason to put the web/bundles folder to ignore is that it’s generated by running the app/console assets:install web command which is also run automatically at the end of the bin/vendors install run. Whatever you have in YourBundle/Resources/public goes to web/bundles/your.

    If you don’t want to install assets each time you change them while developing, use the --symlink argument:

    app/console assets:install --symlink web
    

    I would like to comment on Elnur Abdurrakhimov answer, but due to not enough reputation: app/console assets:install web removes everything in web/ so make sure to copy everything to src/<Bundle>/Resources/public before execute the command the first time.

    Git Baby is a git and github fan, let's start git clone.