Yes, you need to gitignore public/js, public/css and public/storage if using it. Then, remove those files from your git repo by committting, git rm -r --cached and push.
Issues with Github when deploying with Laravel Forge
When I make some local changes to let say a js file, I would run npm run dev on my local machine to recompile all js files into a single app.js, which is located in public. When I then push to git, Laravel Forge shows the error from git in the deployment process that some files would be overwritten by a merge (I guess it’s the old app.js on the server which is to be replaced by a new). When Laravel Forge deploys, it runs this: https://gist.github.com/BenSampo/aa5f72584df79f679a7e603ace517c14. This includes npm run prod. Should the app.js file on both my local machine and the server be added to the gitignore, or should the script somehow delete the old app.js before pulling from github?
Please or to participate in this conversation.