Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alexh's avatar
Level 5

Best practice deployment? To gulp or not to gulp?

Hey there! I'm just a little bit confused because I stumbled upon the following thread: https://laracasts.com/discuss/channels/forge/forge-fails-every-time

I'm having issues when I deploy on my server via forge:

"error: Your local changes to the following files would be overwritten by merge: public/css/app.css public/css/app.css.map Please, commit your changes or stash them before you can merge. Aborting"

So I suppose this is because I run gulp in my deploy script. But this is a bad practice?

Looking forward to hear from you! Many thanks and sorry if the question is too dumb!

0 likes
4 replies
Cronix's avatar

It looks like you have your app.css committed in git. If you're going to build those (dynamic) files on production as part of your deployment process, they shouldn't be included in your repo.

1 like
Cronix's avatar
Cronix
Best Answer
Level 67

Well, the actual build files should be included, not the rendered assets. So public/css/app.css should be ignored by git and any others that get generated by grunt.

1 like
zachleigh's avatar

I disagree. You shouldnt be building resources on a production server. What if the build fails? What if the build produces output that is different than you expect? What if the npm packages in your git repo and your dev machine fall out of sync? What happens if I access your site after you push your code but before your resources are built? Build it locally, run your tests to make sure everything works, and then push it up.

1 like

Please or to participate in this conversation.