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

rezaulhreza's avatar

Your local changes to the following files would be overwritten by merge

When i try to deploy my project from github i am gettting the below error message. HOw shall I fix it? I tried the hints given in forge also other methods. Not Working.

error: Your local changes to the following files would be overwritten by merge:
	vendor/composer/autoload_classmap.php
	vendor/composer/autoload_files.php
	vendor/composer/autoload_static.php
Please commit your changes or stash them before you merge.
Aborting```
0 likes
4 replies
MohamedTammam's avatar

In forge, under "Self Help" choose "Reset Git State"

That will delete any uncommitted changes on the production server.

3 likes
tykus's avatar

Really your vendor directory should not be in version control; so the correct fix is to

  • clean the changes (on the server) Then in your repo
  • add /vendor to your .gitignore file so it is not longer tracked
  • and remove the tracked history on vendor
git reset --hard && git clean -df
echo "/vendor" >> .gitignore
git rm -r --cached ./vendor
1 like
martinbean's avatar

@rezaulhreza This means you’ve changed files on your server after deploying. You should not be touching or changing any files after a deployment.

1 like

Please or to participate in this conversation.