Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal: pathspec '.' did not match any files when trying git rm

Tags:

git

I am just running following command on a folder which is part of git repo

The command I am running is: git rm -r --cached . However git is constantly throwing following error:

fatal: pathspec '.' did not match any files

I have no idea why is that. . definitely exists and is definitely part of a git repo. The error does not explain much in detail

like image 896
Lost Avatar asked Dec 07 '25 09:12

Lost


1 Answers

Probably you have gotten yourself into a folder with no tracked files. Since git does not track folders, only files, there is no useful sense in which this folder "exists" for git.

like image 65
matt Avatar answered Dec 10 '25 01:12

matt