无法使用GIT rm创建rm文件夹?

无法使用GIT rm创建rm文件夹?,git,git-rm,Git,Git Rm,我想用GIT删除整个目录。。。每次我都会犯同样的错误,不明白为什么会发生这种情况 我想删除“蓝白”文件夹 ├── css │   ├── design.css │   └── red_white.css ├── images │   ├── blue_white │   │   ├── accordion-button.png │   │   ├── accordion-shadow.png │   │   ├── button1.png │   │   ├── oem-slide-shadow

我想用GIT删除整个目录。。。每次我都会犯同样的错误,不明白为什么会发生这种情况

我想删除“蓝白”文件夹

├── css
│   ├── design.css
│   └── red_white.css
├── images
│   ├── blue_white
│   │   ├── accordion-button.png
│   │   ├── accordion-shadow.png
│   │   ├── button1.png
│   │   ├── oem-slide-shadow.png
│   │   └── truncate-arrow.png
│   └── red_white
│       ├── accordion-shadow.png
└── pages.xml
当我这么做的时候

git rm -r blue_white/
fatal: pathspec 'f04/blue_white/' did not match any files
我明白了

git rm -r blue_white/
fatal: pathspec 'f04/blue_white/' did not match any files
  • $rm-r图像/蓝白/
  • $git rm-r图像/蓝色\u白色/
  • $git commit-m'删除图像/blue\u白色目录'

  • 听起来你好像在
    f04
    目录下,而不是
    images
    目录下。

    这很有效

    git rm -r --cached blue_white 
    

    然后做一个提交。

    我刚刚注意到,
    git rm
    在删除最后一个剩余文件时删除了一个目录

    执行
    git rm myDir/myFile


    目录
    myDir
    不见了。请注意,我没有使用
    -r
    选项。

    您想完全删除
    images/blue\u-white/
    目录还是将其从git控件中取出?在第2步(git rm-r images/blue\u-white/)中仍然会遇到相同的问题错误:
    致命:路径规范……。