It isnt enough to add them to gitignore. You also need to tell git to remove them. Be aware that this removes them from your computer, so you need to recompile locally :)
git rm <filename>
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi All, Just a quick one, pushing my Inertia Laravel Vue Project to production every time I push from local after compiling my npm run watch it always pushes the same public/js/resources..... etc
So when forge tries to deploy it fails saying it cant merge these public files any solutions?
Thu 1 Sep 13:59:28 BST 2022
* branch main -> FETCH_HEAD
ee42fa9..a79c75f main -> origin/main
error: Your local changes to the following files would be overwritten by merge:
public/js/resources_js_Pages_Bookings_View_vue.js
public/js/resources_js_Pages_Companies_Show_vue.js
public/js/resources_js_Pages_Services_Booking_vue.js
Please commit your changes or stash them before you merge.
Aborting
Updating ee42fa9..a79c75f
I have tried this in the git ignore
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
/.vscode
/public/dist
/public/js
public/js/*
/public/mix-manifest.json
Another solution is to reset on production before you pull
git reset --hard
Please or to participate in this conversation.