# how to list all files that will be comitted

8 messages from 2008-06-25 to 2008-06-25. Participants: Rhodes, Kate, Ian Hilt, Reece Dunn, Karl Hasselström, Michael J Gruber.
Thread: https://gitlist.dev/t/14148

## Rhodes, Kate, 2008-06-25 15:31

Subject: how to list all files that will be comitted
Message-ID: <644094BE-2835-41EF-B1B4-615B8A4BD509@gmail.com>
URL: https://gitlist.dev/e/644094BE-2835-41EF-B1B4-615B8A4BD509%40gmail.com

```
I know ls-files is the tool I need but I haven't been able to figure  
out what combination of options will give me the files that have been  
added to the index.

-Kate

```

## Ian Hilt, 2008-06-25 15:57

Subject: Re: how to list all files that will be comitted
Message-ID: <alpine.LFD.1.10.0806251154180.5755@sys-0.hiltweb.site>
URL: https://gitlist.dev/e/alpine.LFD.1.10.0806251154180.5755%40sys-0.hiltweb.site
In-Reply-To: <644094BE-2835-41EF-B1B4-615B8A4BD509@gmail.com>

```
On Wed, 25 Jun 2008 at 11:31am -0400, Rhodes, Kate wrote:

> I know ls-files is the tool I need but I haven't been able to figure out what
> combination of options will give me the files that have been added to the
> index.
> 
> -Kate

Have you tried "git status" ?  It will output something similar to the
following:

# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	modified:   somefile
#
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#
#	modified:   anotherfile
#


-- 
Ian Hilt
Ian.Hilt (at) gmx.com
GnuPG key: 0x4AFC1EE3

```

## Rhodes, Kate, 2008-06-25 16:01

Subject: Re: how to list all files that will be comitted
Message-ID: <17C0F998-66C0-4DFC-90EB-B85FF6E07844@gmail.com>
URL: https://gitlist.dev/e/17C0F998-66C0-4DFC-90EB-B85FF6E07844%40gmail.com
In-Reply-To: <alpine.LFD.1.10.0806251154180.5755@sys-0.hiltweb.site>

```
yeah, but i was hoping for plumbing, not porcelain, that showed just  
what i wanted so that i didn't have to parse status' output.

-Kate

On Jun 25, 2008, at 11:57 AM, Ian Hilt wrote:

> Have you tried "git status" ?  It will output something similar to the
> following:

```

## Reece Dunn, 2008-06-25 16:14

Subject: Re: how to list all files that will be comitted
Message-ID: <3f4fd2640806250914v7b0ee72aw65f5dfe72790ce3c@mail.gmail.com>
URL: https://gitlist.dev/e/3f4fd2640806250914v7b0ee72aw65f5dfe72790ce3c%40mail.gmail.com
In-Reply-To: <644094BE-2835-41EF-B1B4-615B8A4BD509@gmail.com>

```
2008/6/25 Rhodes, Kate <masukomi@gmail.com>:
> I know ls-files is the tool I need but I haven't been able to figure out
> what combination of options will give me the files that have been added to
> the index.
>
> -Kate

`git status` will do this, unless you need to do additional processing
on the results.

HTH,
- Reece

```

## Karl Hasselström, 2008-06-25 16:14

Subject: Re: how to list all files that will be comitted
Message-ID: <20080625161439.GA1794@diana.vm.bytemark.co.uk>
URL: https://gitlist.dev/e/20080625161439.GA1794%40diana.vm.bytemark.co.uk
In-Reply-To: <17C0F998-66C0-4DFC-90EB-B85FF6E07844@gmail.com>

```
On 2008-06-25 12:01:49 -0400, Rhodes, Kate wrote:

> yeah, but i was hoping for plumbing, not porcelain, that showed just
> what i wanted so that i didn't have to parse status' output.

Unless you want a listing of all the files in the index, you probably
want to call diff-index.

  git diff-index --cached <tree-ish>

gives you the diff between the index and a tree-ish. With the
--name-only option, you get only the filenames and not all the modes,
blob sha1s, etc.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

```

## Rhodes, Kate, 2008-06-25 16:16

Subject: Re: how to list all files that will be comitted
Message-ID: <54450C0E-1AC8-4CE8-919C-8326ACC588EB@gmail.com>
URL: https://gitlist.dev/e/54450C0E-1AC8-4CE8-919C-8326ACC588EB%40gmail.com
In-Reply-To: <20080625161439.GA1794@diana.vm.bytemark.co.uk>

```
Perfect, exactly what I wanted. Thanks.

-Kate


On Jun 25, 2008, at 12:14 PM, Karl Hasselström wrote:

> On 2008-06-25 12:01:49 -0400, Rhodes, Kate wrote:
>
>> yeah, but i was hoping for plumbing, not porcelain, that showed just
>> what i wanted so that i didn't have to parse status' output.
>
> Unless you want a listing of all the files in the index, you probably
> want to call diff-index.
>
>  git diff-index --cached <tree-ish>
>
> gives you the diff between the index and a tree-ish. With the
> --name-only option, you get only the filenames and not all the modes,
> blob sha1s, etc.
>
> -- 
> Karl Hasselström, kha@treskal.com
>      www.treskal.com/kalle

```

## Michael J Gruber, 2008-06-25 16:19

Subject: Re: how to list all files that will be comitted
Message-ID: <g3tr63$fqn$1@ger.gmane.org>
URL: https://gitlist.dev/e/g3tr63%24fqn%241%40ger.gmane.org
In-Reply-To: <644094BE-2835-41EF-B1B4-615B8A4BD509@gmail.com>

```
Rhodes, Kate venit, vidit, dixit 25.06.2008 17:31:
> I know ls-files is the tool I need but I haven't been able to figure  
> out what combination of options will give me the files that have been  
> added to the index.

I don't think git ls-files does that, but

git diff --cached --name-only

will.

Cheers,
Michael

```

## Ian Hilt, 2008-06-25 16:24

Subject: Re: how to list all files that will be comitted
Message-ID: <alpine.LFD.1.10.0806251219480.5755@sys-0.hiltweb.site>
URL: https://gitlist.dev/e/alpine.LFD.1.10.0806251219480.5755%40sys-0.hiltweb.site
In-Reply-To: <17C0F998-66C0-4DFC-90EB-B85FF6E07844@gmail.com>

```
On Wed, 25 Jun 2008 at 12:01pm -0400, Rhodes, Kate wrote:

> yeah, but i was hoping for plumbing, not porcelain, that showed just what i
> wanted so that i didn't have to parse status' output.

I wasn't able to make "git ls-files" do what you want.  However, "git
diff --name-only --cached" did.  It's still porcelain, but it does what
you want :)


-- 
Ian Hilt
Ian.Hilt (at) gmx.com
GnuPG key: 0x4AFC1EE3

```
