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

Posted feifeicui

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git解决error: The following untracked working tree files would be overwritten by checkout相关的知识,希望对你有一定的参考价值。

在IDEA中进行分支切换时,出现如此错误,导致无法正常切换:error: The following untracked working tree files would be overwritten by checkout
通过错误提示可知,是由于一些untracked working tree files引起的问题。所以只要解决了这些untracked的文件就能解决这个问题。

    解决方式:

    打开SourceTree通过命令行,进入本地版本仓库目录下,直接执行


git clean -d -fx
即可。可能很多人都不明白-d,-fx到底是啥意思,其实git clean -d -fx表示:删除 一些 没有 git add 的 文件;

    git clean 参数 

    -n 显示将要删除的文件和目录;

    -x -----删除忽略文件已经对git来说不识别的文件

    -d -----删除未被添加到git的路径中的文件

    -f -----强制运行

    git clean -n

    git clean -df

    git clean -f
https://blog.csdn.net/lisulong1/article/details/78910727

以上是关于git解决error: The following untracked working tree files would be overwritten by checkout的主要内容,如果未能解决你的问题,请参考以下文章

git pull的时候发生冲突的解决方法之“error Your local changes to the following files would be overwritten by merge”

git pull遇到错误:error: Your local changes to the following files would be overwritten by merge:

git 解决 Your local changes to the following files would be overwritten by merge:

git:error: Your local changes to the following files would be overwritten by merge:

git发生冲突:error: Your local changes to the following files would be overwritten by merge

在Linux上git pull线上仓库代码时,出现error: Your local changes to the following files would be overwritten by me