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.
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.
-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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With