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

MB's avatar
Level 2

Failed deployment on Forge (local changes to be overwritten, github)

I have not been having that many problems deploying changes with Laravel Forge, until now. I'm kinda new to github and not sure what to do about this error (from Forge):

 * branch            master     -> FETCH_HEAD
   e977ed3..b50e16a  master     -> origin/master
error: Your local changes to the following files would be overwritten by merge:
	public/css/app.css
	public/css/style.min.css
	public/js/app.js
	public/mix-manifest.json
Please commit your changes or stash them before you merge.
Aborting

I read somewhere to do this on the server:

git checkout .

Not sure what that does and if it works or not.

Hope someone will be able to help me here :)

, Kenneth

0 likes
5 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

In short git checkout . will just remove those local (forge) changes. Should be fine as they will be overwritten by the new version in git. The reason they are changed on forge is most likely because you ran npm run prod on forge

1 like
MB's avatar
Level 2

Okay, so do git checkout . on the server and then Deploy on Forge right after to pull latest from Github?

Update: me running npm run prod on my server is probably correct :p

MB's avatar
Level 2

Thanks, that worked perfectly :D

Tenatious's avatar

The problem can be solved by one time running the git checkout . and then adding those 4 files to your .gitignore file if you're planning on running npm run prod on the server.

The reason this is happening is because you've run the npm run prod command it has generated those 4 files on your server. As you've already built them locally and then pushed them to the repo it's then saying it can't do a pull because it can't merge those files on top of each other.

Please or to participate in this conversation.