- 1 Min. Read.
git pull from your origin you might be greeted by the following error:
What triggers this error?
Say you have the following folder structure:
You initialize a repository, add a remote and pull from master, and coincidentally, there’s a file in the repository called
Git is warning you here, that pulling will overwrite your local
file.txt (and protecting you from yourself!).
Force overwrite the local file
If you’re certain that you want to overwrite your local files, you can use the following command:
git fetch --all && git reset --hard origin/master
Use with caution!