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.
A concept by Wonderlus

Warning: Parameter 1 to W3_Plugin_TotalCache::ob_callback() expected to be a reference, value given in /mnt/home_bingo/codecaptain/codecaptain.io/public/wp-includes/functions.php on line 3583