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:

  • How can I push changes directly from Cloud9 IDE to Heroku?
  • Complex interactive rebase in one step?
  • Git. Undo staged changes in working directory, keeping staged area untouched
  • git pull automatic via crontab
  • Netbeans with GitHub commit only selected files
  • Why I can't close pull request by cherry-pick on github
  • /web/bundles/

  • How to push Tag to Bitbucket Git Repository in Bamboo from Cake build task?
  • get a clean file copy from git
  • git client which can do a directory diff
  • How to set up Git source control for matlab?
  • How can I manage Go dependencies while checking the vendor directory into version control?
  • Ignore a file when merging — but include it in pushes
  • 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.