Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

/web/bundles/
/app/bootstrap*
/app/cache/*
/app/logs/*
/vendor/
/app/config/parameters.yml
like image 288
user1325159 Avatar asked Apr 10 '12 23:04

user1325159


2 Answers

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
like image 96
Elnur Abdurrakhimov Avatar answered Nov 09 '22 01:11

Elnur Abdurrakhimov


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.

like image 3
Sebus Avatar answered Nov 09 '22 01:11

Sebus