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

Hondaman900's avatar

Commit to Forge server error

I was debugging a Laravel package (PDFMerge) that seemed to work on my local dev but not on my Forger remote server. I used Composer on the remote Forge server (vis SSH) to manually install the package again. Turned out that was not the issue, but since then all commits (via SourceTree/Bitbucket/Git) fail to sync on Forge, giving the following error:

error: Your local changes to the following files would be overwritten by merge: app/Http/Controllers/ReportsController.php composer.json composer.lock resources/views/chooseReport.blade.php Please commit your changes or stash them before you merge. Aborting

I tried overwriting the remote comoser.lock and composer.json files via FTP so that they'd match, to no avail. The error went unnoticed for an additional 9 commits of local dev, so now I don't know how to overcome the block on updating the Forge server and sync up the subsequent 9 commits to get back in sync.

Is there a correct way to do this? I can't find a consistent answer out there and am reluctant to start trying things and make this worse. Any recommendations are very welcome.

I'm running Laravel 5.5 on NGINX/MySQL locally with Laragon and remotely via Forge.

Thanks in advance for any assistance.

0 likes
5 replies
Dalma's avatar

I think the issue you are facing is not with composer but with git on the forge server. I have run into this and had to execute a git command to stash my changes.

Hondaman900's avatar

@DALMA - Thanks for the quick response. Yes indeed, but what git command and executed locally or on the Forge server?

Hondaman900's avatar

Fixed (I hope): In my SSH terminal I did the following (after looking up Git stash command options)

git stash save "clear composer obstructions"

Seems to have cleared the obstruction. A new edit gets updated to the Forge server on commit and no errors.

Now not sure how to apply the prior missing commits or if they now flow through automatically...?

Hondaman900's avatar

Update: Looks like it did all the missing updates. I'm back in the game. Thank you!

Please or to participate in this conversation.