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

varundavda's avatar

Laravel forge git error.

I am trying to deploy my project using laravel forge.

Below is my git status result on local project.

git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean

Below is my git push result.

git push
Everything up-to-date

But as soon as I deploy it, I get the following error.

* branch            master     -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
    storage/app/public/.gitignore
Please, commit your changes or stash them before you can merge.

Please help.

0 likes
1 reply
Nash's avatar

Like it says, the file storage/app/public/.gitignore on your server is different than the same file in your master branch (it contains changes that have not been commited). Have you made any changes to it directly on the server?

If you wish to keep the version on the server, just commit it and push like you would normally do. If you wish to ignore the changes and just allow it to be overwritten, you can do git checkout storage/app/public/.gitignore on the server to revert the file to its original state. After this, you should be able to deploy (git pull) normally.

Tip: git diff will show you the differences between the two versions of the file.

1 like

Please or to participate in this conversation.