git解决error: The following untracked working tree files would be overwritten by checkout(转)

When the branch switching IDEA, there is such an error, leading to not switch correctly: error: The following untracked working tree files would be overwritten by checkout

By error shows that the problem is due to a number of untracked working tree files caused. So long as the solution to these untracked files can solve this problem.

    Solution:

    Open SourceTree via the command line, enter the local version of warehouses directory, direct execution

 

git clean -d -fx
can be. Many people may not understand -d, -fx in the end What do you mean, in fact, git clean -d -fx said: do not git add remove some files;

    git clean parameters 

    -n display will be deleted files and directories;

    -x ----- delete the file has been ignored for git is not a recognized file

    -d ----- delete not added to the git path of the file

    -f ----- forced to run

    git clean -n

    git clean -df

    Clean -f git
----------------
Disclaimer: This article is CSDN blogger original article "awesome_go", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/u013452337/article/details/81360210

Guess you like

Origin www.cnblogs.com/logBlog/p/12012993.html