12

GIT を使用してディレクトリ全体を削除したい...毎回同じエラーが発生し、なぜこれが起こっているのか理解できません。

「blue_white」フォルダを削除したいのですが…

├── 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
4

4 に答える 4

22
  1. $ rm -r images/blue_white/
  2. $ git rm -r images/blue_white/
  3. $ git commit -m 'Remove images/blue_white directory'
于 2012-09-13T14:06:30.607 に答える
4

f04ディレクトリではなく、ディレクトリにいるようですimages

于 2012-09-13T14:08:14.507 に答える
1

git rm最後に残ったファイルが削除されると、ディレクトリが削除されることに気付きました。

myFileに常駐するだけでmyDir、実行後に
git rm myDir/myFile
ディレクトリmyDirがなくなりました。-rオプションを使用しなかったことに注意してください。

于 2014-02-24T15:24:50.550 に答える
1

これは機能します

git rm -r --cached blue_white 

次に、コミットを行います。

于 2013-08-16T09:55:48.363 に答える