Git checkout/pull doesn't remove directories?

前端 未结 5 2096
暗喜
暗喜 2020-11-30 17:57

I\'ve got my repo @ github. I did some work at home and pushed it to github. It involved some deleting of files and directories. Now I\'m on my work box, which had a copy of

5条回答
  •  执笔经年
    2020-11-30 18:48

    I had same issue, in my case on build service (CI).. as GIT pulls all files without cleaning folders, all the bin / obj that were previously builded by the CI are dirty, so If I remove a test project, the bin will still contain the DLL and will mention tests that does not exist.

    In order to solve this issue; this command seems to do the trick (at least for me)

    git clean -fd -x
    

    where X will remove all untracked files:

    -X Remove only files ignored by Git. This may be useful to rebuild everything from scratch, but keep manually created files.

提交回复
热议问题