Error pulling origin: error: Your local changes to the following files would be

When git is pulling, when this error occurs, many people may enter to stash. For related stash, please see: Error pulling origin: error: Your local changes to the following files would be overwritten by merge

But after finding the stash, it will still appear: Error pulling origin: error: The following untracked working tree files would be overwritten by merge...

In fact, you can see the error message, it is because of some problems caused by untracked working tree files. So as long as these untracked files are resolved, the problem can be solved.

There are two ways to solve it:

Method 1: If you have tools for installing git, of course, graphical tools, such as tortoiseGit, you can use these tools to select your project folder and right-click to cleanup.

Method 2: Through the command line, you can directly execute git clean -d -fx. Many people may not understand what -d and -fx mean. The next article about git will introduce things related to git clean.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326196316&siteId=291194637