Git Pull While Ignoring Local Changes

Git pull may result with the following error 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.

The following solution works for me:

Fetch all changes:

git fetch --all

Reset

git reset --hard origin/master

Pull

git pull

 

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 )

Facebook photo

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

Connecting to %s