Title
Fork me on GitHub

解决使用【git check】切换分支命令时出现error的错误!

问题:

PS D:\PycharmProject(D)\Baidu-Image-Loader> git checkout master
error: The following untracked working tree files would be overwritten by checkout:
        .idea/.gitignore
        .idea/Baidu-image-loader.iml
        .idea/deployment.xml
        .idea/inspectionProfiles/Project_Default.xml
        .idea/inspectionProfiles/profiles_settings.xml
        .idea/misc.xml
        .idea/modules.xml
Please move or remove them before you switch branches.
Aborting

解决:
1、git status
2、git clean -dfx
3、之后就可以正常切换了

PS D:\PycharmProject(D)\Baidu-Image-Loader> git status
On branch 1.0
Your branch is up to date with 'origin/1.0'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .idea/
        __pycache__/
nothing added to commit but untracked files present (use "git add" to track)
PS D:\PycharmProject(D)\Baidu-Image-Loader> git clean -dfx
Removing .idea/
Removing __pycache__/
PS D:\PycharmProject(D)\Baidu-Image-Loader> git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
PS D:\PycharmProject(D)\Baidu-Image-Loader> git checkout 1.0
Switched to branch '1.0'
Your branch is up to date with 'origin/1.0'.
posted @ 2023-09-14 22:05  新西兰蟹老板  阅读(205)  评论(0编辑  收藏  举报