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


git reset --hard origin/master


git pull


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 )

Facebook photo

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

Connecting to %s