Why doesn't Git remove some files when I switch a branch?

后端 未结 3 1185
没有蜡笔的小新
没有蜡笔的小新 2020-12-11 01:04

I have had this happen to me often. I am working on a master branch and I need to test a plugin, so I create a new branch and check it out. I download the plugin into the pr

3条回答
  •  轮回少年
    2020-12-11 01:25

    If you are switching back and forth between branches where the directory structures are different, and you find that there are some artifacts left over, you might need to run:

    git clean -df
    

    This will "delete" "force". You will loose ALL untracked files, I think this might be one step away from:

    git reset --hard
    

提交回复
热议问题