The following untracked working tree files would be overwritten by merge

  • 1 Min. Read.

When you 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 file.txt.

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:

Use with caution!

Was this article helpful?

Related guides

Comments 0
There are no comments at the moment.