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 comment