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:
wp-content/plugins/plugin_name/file.php

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:

http://stackoverflow.com/questions/15745045/how-do-i-resolve-git-saying-commit-your-changes-or-stash-them-before-you-can-me

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s