Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cant rm folder with GIT rm?

Tags:

git

git-rm

I want to remove an entire directory with GIT ... each time I keep getting the same error and don't understand why this is happening.

I want to remove the "blue_white" folder ...

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

When I do this ...

git rm -r blue_white/

I get this ...

fatal: pathspec 'f04/blue_white/' did not match any files
like image 208
rsturim Avatar asked Sep 13 '12 13:09

rsturim


People also ask

How do I remove a folder from my git repository?

Browse to the directory in the repository and branch that you want to delete. In the top-right corner, click "…", and then Delete directory. Review the list of files. Depending on your permissions and the branch protection rules, choose to either commit the change directly or propose the change using a pull request.

Does git rm actually delete the file?

By default, the git rm command deletes files both from the Git repository as well as the filesystem. Using the --cached flag, the actual file on disk will not be deleted.

What is the difference between rm and git rm?

Git rm vs rm The git rm command removes the file from both the git repository and the local file system. The rm command, on the other hand, only removes the file from the file system.

How do I remove a directory from git stage?

In Git, we can use git reset HEAD -- 'files/folders/patterns' to remove files or folders from the staging area (Changes to be committed).


1 Answers

  1. $ rm -r images/blue_white/
  2. $ git rm -r images/blue_white/
  3. $ git commit -m 'Remove images/blue_white directory'
like image 124
Nick Kugaevsky Avatar answered Sep 30 '22 04:09

Nick Kugaevsky