git 切换分支,警告提示 不能删除vendor目录

假设当前分支是dev

执行git checkout master

提示如下,

warning: unable to rmdir vendor/monolog/monolog: Directory not empty
warning: unable to rmdir vendor/nesbot/carbon: Directory not empty
warning: unable to rmdir vendor/psr/log: Directory not empty
warning: unable to rmdir vendor/ramsey/uuid: Directory not empty
warning: unable to rmdir vendor/symfony/polyfill-mbstring: Directory not empty
warning: unable to rmdir vendor/symfony/translation: Directory not empty
Switched to branch 'master'
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
  (use "git pull" to update your local branch)

vendor目录,是composer生成的,在 master分支下是没有的。

ps:用sourcetree,在dev分支拉取代码,会提示
fatal: No url found for submodule path 'vendor/monolog/monolog' in .gitmodules

我开始以为是子模块配置有问题,但是在项目根目录下,没有找到.gitmodules,我自己也没有添加子模块。

谢谢~

阅读 7.9k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进