Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Still untracked files even after using git add

Tags:

git

Guys, even after using "git add ." I still have untracked files that I can't commit.

There was another question with the same problem, but in that case it was related to case-sensitive folder. I didn't change the name of any folders here.

like image 570
Felipe Avatar asked May 11 '11 03:05

Felipe


People also ask

Does git add add untracked files?

The easiest way to add all files to your Git repository is to use the “git add” command followed by the “-A” option for “all”. In this case, the new (or untracked), deleted and modified files will be added to your Git staging area.

Why is my file untracked git?

Untracked files are those that are in the repo's directory but have not yet been added to the repo's index with git add .


2 Answers

The . in the git add . command refers to the "current directory". So, running git add . will add all the files in the current directory and its subdirectories. You should ensure that you are in the correct directory before running git add ..

If you're one level down in a subdirectory, then git add .. would be equivalent to cd ..; git add ..

like image 195
Greg Hewgill Avatar answered Sep 19 '22 15:09

Greg Hewgill


git add -A is what you want. It will add everything. This includes files you deleted.

like image 22
Adam Dymitruk Avatar answered Sep 20 '22 15:09

Adam Dymitruk