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

Elliot_putt's avatar

Vue Laravel Git Ignore File

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

0 likes
4 replies
Sinnbeck's avatar

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>
1 like
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Another solution is to reset on production before you pull

git reset --hard
1 like

Please or to participate in this conversation.