On Monday, March 25, 2013 11:43:21 AM UTC+1, Jeroen De Vlieger wrote:

> lets create a new git repo 
>
> $ mkdir testRepo
> $ cd testRepo
> $ mkdir dirWithOnlyIgnoredFiles
> $ touch dirWithOnlyIgnoredFiles/foo.log
> $ touch test.txt
> $ touch main.log
> $ git init
>
> now lets ignore the log files
>
> $ echo '*.log' > .gitignore
>
> stage all non-ignored files and creat a commit 
>
> $ git add .
> $ git commit -m 'foo'
>
> now lets list the ignore files
>
> $ git status --ignored
> # On branch master
> # Ignored files:
> #   (use "git add -f <file>..." to include in what will be committed)
> #
> # main.log
> nothing to commit (working directory clean)
>
> Note the the log file in the 'dirWithOnlyIgnoredFiles' is *not* listed, 
> although I would presume that it is indeed an ignored file.
> What happened here?
>
>
Git ignores empty directories (by design). A directory with only ignored 
files is also counted as being empty. Hence, when you add a non-ignored 
file inside the directory, the directory gets noticed.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to