# Problem with add folder to a subdirectory

4 messages from 2010-04-03 to 2010-04-04. Participants: Aris Bezas, Ramkumar Ramachandra, Bo Yang.
Thread: https://gitlist.dev/t/23320

## Aris Bezas, 2010-04-03 08:26

Subject: Problem with add folder to a subdirectory
Message-ID: <28125580.post@talk.nabble.com>
URL: https://gitlist.dev/e/28125580.post%40talk.nabble.com

```

Hi,
I am new to git and i have a problem. I clone repo from a collaborator and i
want to add some folder to a subdirectory.
When i add a folder to the root dir ($ git add TestFolder) i have no problem
but when i try to put it in a different subdirectory like ($ git add
examples/TestFolder) then with the command ($ git status) i tsake no result
(nothing to commit (working directory clean)).

Thanks for your reply

Aris Bezas Sat, 03 April 2010, 11:26
-- 
View this message in context: http://old.nabble.com/Problem-with-add-folder-to-a-subdirectory-tp28125580p28125580.html
Sent from the git mailing list archive at Nabble.com.

```

## Ramkumar Ramachandra, 2010-04-03 09:13

Subject: Re: Problem with add folder to a subdirectory
Message-ID: <h2yf3271551004030213u1441cf4akd0898aa3a418eda9@mail.gmail.com>
URL: https://gitlist.dev/e/h2yf3271551004030213u1441cf4akd0898aa3a418eda9%40mail.gmail.com
In-Reply-To: <28125580.post@talk.nabble.com>

```
On Sat, Apr 3, 2010 at 1:56 PM, Aris Bezas <igoumeninja@gmail.com> wrote:
> i tsake no result
> (nothing to commit (working directory clean)).

I suspect that you're trying to add an empty directory. Git tracks
content, not individual files and directories- so try adding some
content (read: a file), and then git-add'ing that.

-- Ram

```

## Ramkumar Ramachandra, 2010-04-03 18:25

Subject: Re: Problem with add folder to a subdirectory
Message-ID: <n2nf3271551004031125g38c52d0cq810ed366f3d1d2d3@mail.gmail.com>
URL: https://gitlist.dev/e/n2nf3271551004031125g38c52d0cq810ed366f3d1d2d3%40mail.gmail.com
In-Reply-To: <990EEB31-9AAB-4CF5-AC05-11BCA45C6447@gmail.com>

```
[Kindly do not cull the list from CC unless absolutely necessary]

On Sat, Apr 3, 2010 at 11:45 PM, Aris Bezas <aribezas@gmail.com> wrote:
> I put a content in the folder (test.txt file) but i there is no result.
> The strange thing is that when i add this in the root directory (where the
> git is) it recognize it but in a subdirection no.

Unless I've misunderstood something, I'm not able to replicate your
issue. Kindly go through some introductory material on Git.

$ git init
Initialized empty Git repository in /tmp/foo/.git/
$ mkdir -p 1/2
$ touch 1/2/test.txt
$ git add 1/2
$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#       new file:   1/2/test.txt
#

-- Ram

```

## Bo Yang, 2010-04-04 03:26

Subject: Re: Problem with add folder to a subdirectory
Message-ID: <n2u41f08ee11004032026p9a0be36er7d2e017e294bbd35@mail.gmail.com>
URL: https://gitlist.dev/e/n2u41f08ee11004032026p9a0be36er7d2e017e294bbd35%40mail.gmail.com
In-Reply-To: <28125580.post@talk.nabble.com>

```
Hi Aris,
On Sat, Apr 3, 2010 at 4:26 PM, Aris Bezas <igoumeninja@gmail.com> wrote:
>
> Hi,
> I am new to git and i have a problem. I clone repo from a collaborator and i
> want to add some folder to a subdirectory.
> When i add a folder to the root dir ($ git add TestFolder) i have no problem
> but when i try to put it in a different subdirectory like ($ git add
> examples/TestFolder) then with the command ($ git status) i tsake no result
> (nothing to commit (working directory clean)).

Are you sure in the root directory, you can add an empty directory to
the index? I don't think so. See:
https://git.wiki.kernel.org/index.php/GitFaq#Can_I_add_empty_directories.3F

Regards!
Bo

```
