Force “git pull” to overwrite local files
git fetch --all
If updating from the master branch, enter:
git reset --hard origin/master
git reset --hard origin/<branch_name>
git fetch function downloads the latest files from GitHub without trying to merge or rebase anything.
git reset resets the master branch to what was just fetched. The
--hard option changes all the files in the working tree to match the files in
Note: This will likely overwrite any local changes, so these steps should only be used when absolutely necessary.