[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] trouble with .gitignore patterns



On 2011-01-16 20:58 +0100, Boyd Stephen Smith Jr. wrote:

> In <[🔎] 20110116160216.GA6914@think.homelan>, Andrei Popescu wrote:
>>$ git init
>>Initialized empty Git repository in /home/amp/Download/gitest/.git/
>>$ touch dir/file3
>>$ echo '*' > .gitignore
>>$ git status -s
>>$ echo '!file1' >> .gitignore
>>$ echo '!dir/' >> .gitignore
>>$ git status -s
>>?? file1
>>$
>>
>>Why is 'dir' still ignored?
>
> Looks like a bug to me.  It is at least an undocumented feature.

The FAQ mentions¹ that you cannot add empty directories in git, and the
'*' in .gitignore means that no _files_ below dir/ will be added.

Sven


¹ https://git.wiki.kernel.org/index.php/GitFaq#Can_I_add_empty_directories.3F


Reply to: