Best practice Larvel gitignore

I want to ask about best practice for Laravel.

I use gulp for my js and css. Which should I include in push in the assets folder (use "gulp" on the server) or in the shared folder (gulp result)?

+5
source share
3 answers

Who should I include in push in the resource folder (use "gulp" on the server) or in the shared folder (gulp result)?

Any generated content should not, if possible, be included in the git repository (and clicked)

If you could have a hook after receiving on the server side that does gulp for you, that would be better.
However, this is not always possible, and on a production server, adding gulp may not always be possible. In this case, the validity of the version of the generated content is acceptable.

+5
source

First, you can add Laravel default .gitignore content: https://github.com/laravel/laravel/blob/master/.gitignore

And add your js, css directory to .gitignore as follows:

/public/css /public/js 

Check this:

 cat .gitignore /vendor /node_modules Homestead.yaml Homestead.json .env /public/css/ /public/js/ 
+2
source

In an ideal world, you do not want to push the generated files to your repository / production server. One reason for this is that adding constantly changing versions of the generated files can cause annoying problems when using git in collaboration with others.

However, each situation with the project is different, and sometimes it is easier to create the generated files and deploy them in this way. In particular, if you work independently from others in the project, there is no real problem with this.

+1
source

Source: https://habr.com/ru/post/1231917/


All Articles