Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git doesn't show untracked directories [duplicate]

Tags:

git

git status command doesn't show new untracked directories and I can't git add them.. How can I resolve this? New and untracked files are shown, the problem is only with new directories.

like image 784
vir2al Avatar asked Aug 29 '13 12:08

vir2al


People also ask

Can I see deleted files in the untracked list in Git?

This time I could see deleted files in the untracked list. Also when I created a directory manually and then added a file inside it, I saw this file also in the untracked files output of git status command. I was also able to execute git add -A and commit the file successfully.

How to show all untracked files in a directory?

-u [], --untracked-files [=] Show untracked files (Default: all). The mode parameter is optional, and is used to specify the handling of untracked files. The possible options are: · no - Show no untracked files · normal - Shows untracked files and directories · all - Also shows individual files in untracked directories.

How to see all files in a new directory in Git?

Using a special parameter in git status we can see all the files in the new directory we want to stage. git status has the untracked-files switch where we select which files to see each time we execute git status.

How do I ignore untracked files in my repository?

If you don't ever want to commit them to your repo, use a .gitignore file to ignore them. More details can be found on the gitignore man page. They won't show up as untracked files when entering your commit message in your $EDITOR.


1 Answers

Git cannot add directories to the repository. Only files can be added.

If you want to add a directory put an empty .gitignore file into it and add it.

like image 74
Sergey K. Avatar answered Sep 27 '22 20:09

Sergey K.