当前位置:   article > 正文

git使用记录2:git使用问题总结_the following untracked working tree files would b

the following untracked working tree files would be overwritten by checkout:

1. The following untracked working tree files would be overwritten by checkout

分支切换时,出现如此错误,导致无法正常切换:error: The following untracked working tree files would be overwritten by checkout

通过错误提示可知,是由于一些untracked working tree files引起的问题。所以只要解决了这些untracked的文件就能解决这个问题。

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

git clean -d -fx
  • 1

即可。可能很多人都不明白-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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

2.There is no tracking information for the current branch.

git pull的时候,报下面的问题:

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/450420
推荐阅读
相关标签
  

闽ICP备14008679号