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

ekaitzastiz's avatar

Ignore css and js only in develop branch

Hi!

I have an app, where I work with a friend developing it, we have ignored public/css/* in GIT because we use sass+gulp so our files are in assets.

But now, when I am going to deploy, I would like not to have the public/css/* file ignored for master branch. I tried many things (.git/config... .git/info/exclude_for_development) and similar things, but first, I am not sure what I am really doing, and second, I want to do, what I am asking. I want to do that, because I don't want to use FTP or I don't want to install node+npm+gulp+bower on the server just to compile sass.... same with bower... In addition we don't have root access for this customer vps, and I think that the person who manages the vps won't want to install all that tools.

Any solution? How do you work usually?

Thank you

0 likes
3 replies
jlrdw's avatar

Have you thought about a second branch, one for deployment? Just a thought.

ekaitzastiz's avatar

i already have two branches, develop and master. but I don't know how to ignore them (public/css/*) in develop and do not ignore them in master....

jlrdw's avatar

I was referring to a seperate branch, one with the css, one without, you'd need a program that when copying one to the other it will filter out the files. Github alone may not work. Kinda like a robocopy type program. But there again I am no expert on all github commands.
EDIT: Repository, not branch, sorry.
EDIT 2: Probably could sync whats needed in masters, then update them on github as needed.

Please or to participate in this conversation.