As git only tracks files and not folders, the behavior regarding push and pull is impossible. It is impossible to add an empty directory to git.
For git status
however this is expected behavior as all files in the folder are new, because git doesn't track any file inside this folder yet.
Also, check the git school, challenge 7. If you type git status
there, you will see this output, although octofamily
contains two files:
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# blue_octocat.txt
# octofamily/
# red_octocat.txt
This is just a simplification in the UI, you still can do git add octofamily/baby_octocat.txt
(However, not in the git school, because it isn't an actual git client).
A subsequent git status
would now reflect this:
$ git status
# On branch master
# Changes to be committed:
# new file: octofamily/baby_octocat.txt
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# blue_octocat.txt
# octofamily/momma_octocat.txt
# red_octocat.txt
Please note, how it now shows the file(s) inside octofamily
, because now that folder is known.