赞
踩
原文网址:git--分支相关问题的解决_IT利刃出鞘的博客-CSDN博客
解决方法
注意:这个操作会覆盖本地的修改,因此建议手动备份
git fetch origin
git reset --hard origin/master
复现
git切换分支时,报此错误:
- Untracked Files Prevent Checkout
- Move or commit them before checkout
解决方法
git checkout -f [branch]
注意
有的地方说用git clean -f。但此命令会删掉这些未追踪文件,不建议使用
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。