# Listing top tracked files and directories only

3 messages from 2011-03-26 to 2011-03-26. Participants: Francis Moreau, Scott Chacon.
Thread: https://gitlist.dev/t/26874

## Francis Moreau, 2011-03-26 16:18

Subject: Listing top tracked files and directories only
Message-ID: <AANLkTi=OMXTJm=mvr70KudS+S9c857z7Kv1qVE1FFdD_@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTi%3DOMXTJm%3Dmvr70KudS%2BS9c857z7Kv1qVE1FFdD_%40mail.gmail.com

```
Hello,

I'd like to find a way to list files and directories tracked by git
but which are only in the top directory of the tracked project.

For example, in a kernel repository:

  $ git-magic-command --magic-options
  .gitignore
  .mailmap
   COPYING
   CREDITS
   Kbuild
   MAINTAINERS
   Makefile
   README
   REPORTING-BUGS
   Documentation/
   arch/
   drivers/
   kernel/
   ...

I tried to come up with something using git-ls-files but fails.

Thanks for any suggestions.
-- 
Francis

```

## Scott Chacon, 2011-03-26 16:24

Subject: Re: Listing top tracked files and directories only
Message-ID: <AANLkTi=0oWTtUbLFjQsh5-Koghz3UwmaPcrFiR2W-hdS@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTi%3D0oWTtUbLFjQsh5-Koghz3UwmaPcrFiR2W-hdS%40mail.gmail.com
In-Reply-To: <AANLkTi=OMXTJm=mvr70KudS+S9c857z7Kv1qVE1FFdD_@mail.gmail.com>

```
Hey,

On Sat, Mar 26, 2011 at 9:18 AM, Francis Moreau <francis.moro@gmail.com> wrote:
> Hello,
>
> I'd like to find a way to list files and directories tracked by git
> but which are only in the top directory of the tracked project.
>
> For example, in a kernel repository:
>
>  $ git-magic-command --magic-options
>  .gitignore
>  .mailmap
>   COPYING

$ git ls-tree --name-only [branch]

Scott

```

## Francis Moreau, 2011-03-26 16:28

Subject: Re: Listing top tracked files and directories only
Message-ID: <AANLkTikbJt6-wz4dw-o4oLKc=0u_8EUFaAoYxokd3GPN@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikbJt6-wz4dw-o4oLKc%3D0u_8EUFaAoYxokd3GPN%40mail.gmail.com
In-Reply-To: <AANLkTi=0oWTtUbLFjQsh5-Koghz3UwmaPcrFiR2W-hdS@mail.gmail.com>

```
On Sat, Mar 26, 2011 at 5:24 PM, Scott Chacon <schacon@gmail.com> wrote:
> Hey,
>
> On Sat, Mar 26, 2011 at 9:18 AM, Francis Moreau <francis.moro@gmail.com> wrote:
>> Hello,
>>
>> I'd like to find a way to list files and directories tracked by git
>> but which are only in the top directory of the tracked project.
>>
>> For example, in a kernel repository:
>>
>>  $ git-magic-command --magic-options
>>  .gitignore
>>  .mailmap
>>   COPYING
>
> $ git ls-tree --name-only [branch]

cool thanks a lot !
-- 
Francis

```
