# empty directories

3 messages from 2007-04-23 to 2007-04-23. Participants: Yakov Lerner, Alex Riesen.
Thread: https://gitlist.dev/t/7797

## Yakov Lerner, 2007-04-23 15:40

Subject: empty directories
Message-ID: <f36b08ee0704230840xa37e149qffa15c5c685524c4@mail.gmail.com>
URL: https://gitlist.dev/e/f36b08ee0704230840xa37e149qffa15c5c685524c4%40mail.gmail.com

```
When I git-add empty directory (mkdir d1;git-add d1),
git refuses to add it [1].

I was told on #git chan that git cannot store empty dirs.
But when I do
         git-add -f emptyDir # where emptyDir is empty dir
, emptyDir is added and then cloned. What does it mean ?

Does it mean that if i git-add emptyDir with -f, it may break
something in the repo ? That I shall not try it ? Or it is ok ?

Thanks
Yakov
.....................................................................
[1] $ mkdir emptyDir
$ git-add emptyDir
The following paths are ignored by one of your .gitignore files:
emptyDir (directory)
Use -f if you really want to add them.
$
Note that the printed warning is misleading.
The name (emptyDir) is not in any .gitignore files.
It would be better to print the real reason for ignoring, no ?

```

## Alex Riesen, 2007-04-23 16:19

Subject: Re: empty directories
Message-ID: <81b0412b0704230919h3be7a67fqec431a6afb6e3760@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0704230919h3be7a67fqec431a6afb6e3760%40mail.gmail.com
In-Reply-To: <f36b08ee0704230840xa37e149qffa15c5c685524c4@mail.gmail.com>

```
On 4/23/07, Yakov Lerner <iler.ml@gmail.com> wrote:
> When I git-add empty directory (mkdir d1;git-add d1),
> git refuses to add it [1].
>
> I was told on #git chan that git cannot store empty dirs.

It can, just refuses to. Which considered good by most

> But when I do
>          git-add -f emptyDir # where emptyDir is empty dir
> , emptyDir is added and then cloned. What does it mean ?

$ git add -f emptyDir
fatal: unable to index file emptyDir

> Does it mean that if i git-add emptyDir with -f, it may break
> something in the repo ? That I shall not try it ? Or it is ok ?

It is not ok and it does not break anything. What git do you
have, as I apparently cannot reproduce it.

```

## Yakov Lerner, 2007-04-23 16:49

Subject: Re: empty directories
Message-ID: <f36b08ee0704230949n5dee717bu2f4107555f4300b@mail.gmail.com>
URL: https://gitlist.dev/e/f36b08ee0704230949n5dee717bu2f4107555f4300b%40mail.gmail.com
In-Reply-To: <81b0412b0704230919h3be7a67fqec431a6afb6e3760@mail.gmail.com>

```
On 4/23/07, Alex Riesen <raa.lkml@gmail.com> wrote:
> On 4/23/07, Yakov Lerner <iler.ml@gmail.com> wrote:
> > When I git-add empty directory (mkdir d1;git-add d1),
> > git refuses to add it [1].
> >
> > I was told on #git chan that git cannot store empty dirs.
>
> It can, just refuses to. Which considered good by most
>
> > But when I do
> >          git-add -f emptyDir # where emptyDir is empty dir
> > , emptyDir is added and then cloned. What does it mean ?
>
> $ git add -f emptyDir
> fatal: unable to index file emptyDir
>
> > Does it mean that if i git-add emptyDir with -f, it may break
> > something in the repo ? That I shall not try it ? Or it is ok ?
>
> It is not ok and it does not break anything. What git do you
> have, as I apparently cannot reproduce it.

It was 1.5.1.
In 1.5.1.2, it refuses to add, yes.
The message is:
fatal: emptyDir/../emptyDir: can only add regular files or symbolic links

Yakov

```
