For me the following worked:
(1) First fetch all changes:
$ git fetch --all (2) Then reset the master:
$ git reset --hard origin/master Note - For users of github, "master" was replaced with "main" in October 2020. For projects created since then you may need to use "main" instead, like:
$ git reset --hard origin/main (3) Pull/update:
$ git pull First fetch all changes:
$ git fetch --allThen reset the master:
$ git reset --hard origin/masterNote - For users of github, "master" was replaced with "main" in October 2020. For projects created since then you may need to use "main" instead, like:
$ git reset --hard origin/mainPull/update:
$ git pull