On Tue, Jan 08, 2013 at 06:34:24PM -0800, msoulier wrote:

> I happened to create a subdirectory in my working set called "bundle", and 
> I noticed that git ignored it.
> 
> Why is that? And what if I need such a directory?

I suppose essentially what you're seeing is Git not showing you an
*empty* directory, and this has nothing to do with its name:

% git status
# On branch master
nothing to commit (working directory clean)
% mkdir bundle
% git status
# On branch master
nothing to commit (working directory clean)
% touch bundle/whatever
% git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       bundle/
nothing added to commit but untracked files present (use "git add" to track)
%

I think this behaviour is due to the fact Git does not explicitly track
directories and they ever exist in the commits it manages because those
commits contain files in those directories.  I mean, the only way to
make a directory get added to a commit, is to add a file in it.  This
also means Git does not support managing empty directories (a topic
provoked heated discussions on the main Git list several times).
Hence looks like tools like `git status` only ever pay attention to
those filesystem objects which are regular files or contain them.

-- 


Reply via email to