Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I add this directory to git?

Tags:

git

$ git add . ; git add *; git status
# On branch master
nothing to commit (working directory clean)

My folder is in there, but I can't add it.

like image 638
TIMEX Avatar asked Dec 17 '22 17:12

TIMEX


2 Answers

By any chance, is the directory blank? You can't add directories to git.

like image 57
Yuji 'Tomita' Tomita Avatar answered Dec 19 '22 06:12

Yuji 'Tomita' Tomita


I know this question is quite old now and the answer has been accepted but I had a similar problem where I couldn't add a directory.

In my case the problem was that I didn't have permission to access the directory. I changed the permissions and then I was able to add it.

like image 36
Pattle Avatar answered Dec 19 '22 07:12

Pattle