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

后端 未结 3 1184
没有蜡笔的小新
没有蜡笔的小新 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:23

    git will not remove untracked files from your working copy, so unless you added the files of the plugin and created a commit on the new branch git will not do anything to your plugin files.

    if you want to remove untracked file from your working tree, use git clean – be careful, it will remove any untracked file from disk and there's no way to recover from that (without using undelete software)

提交回复
热议问题