How to ignore error on git pull with local changes would be overwritten by merge?

I have changed some files on my local machine, pushed them to a remote repository, and now I’m trying to pull the changes to the server and I get the message;

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

Please, commit your changes or stash them before you can merge.

So What I simply did that …..

Moyens-MBP:~ moyen$ git checkout wp-content/plugins/pluginname/file.php
Moyens-MBP:~ moyen$ git commit -m “merged”
Moyens-MBP:~ moyen$ git pull
Moyens-MBP:~ moyen$ git push origin master

and this makes override the local file with the remote one (git checkout filepath) and deploys the other changes.

Helpful Link:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s