# how to make a commit only contain existing files

4 messages from 2010-12-07 to 2010-12-08. Participants: david@lang.hm, Jeff King.
Thread: https://gitlist.dev/t/25986

## david@lang.hm, 2010-12-07 21:00

Subject: how to make a commit only contain existing files
Message-ID: <alpine.DEB.2.00.1012071203190.662@asgard.lang.hm>
URL: https://gitlist.dev/e/alpine.DEB.2.00.1012071203190.662%40asgard.lang.hm

```
I know that I can do a git rm to explictly remove files, but is there an 
easy way to just say that this commit should contain all the files that 
exist at this point in time, without carrying over any files that were in 
a prior commit but that don't exist now?

David Lang

```

## Jeff King, 2010-12-07 21:11

Subject: Re: how to make a commit only contain existing files
Message-ID: <20101207211126.GA29453@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20101207211126.GA29453%40sigill.intra.peff.net
In-Reply-To: <alpine.DEB.2.00.1012071203190.662@asgard.lang.hm>

```
On Tue, Dec 07, 2010 at 01:00:18PM -0800, david@lang.hm wrote:

> I know that I can do a git rm to explictly remove files, but is there
> an easy way to just say that this commit should contain all the files
> that exist at this point in time, without carrying over any files
> that were in a prior commit but that don't exist now?

Won't "git add -A; git commit" do what you want?

-Peff

```

## david@lang.hm, 2010-12-08 00:52

Subject: Re: how to make a commit only contain existing files
Message-ID: <alpine.DEB.2.00.1012071652160.662@asgard.lang.hm>
URL: https://gitlist.dev/e/alpine.DEB.2.00.1012071652160.662%40asgard.lang.hm
In-Reply-To: <20101207211126.GA29453@sigill.intra.peff.net>

```
On Tue, 7 Dec 2010, Jeff King wrote:

> On Tue, Dec 07, 2010 at 01:00:18PM -0800, david@lang.hm wrote:
>
>> I know that I can do a git rm to explictly remove files, but is there
>> an easy way to just say that this commit should contain all the files
>> that exist at this point in time, without carrying over any files
>> that were in a prior commit but that don't exist now?
>
> Won't "git add -A; git commit" do what you want?

it very well may, I'll have to upgrade git on that box to a version that 
supports it.

Thanks.

David Lang

```

## Jeff King, 2010-12-08 03:39

Subject: Re: how to make a commit only contain existing files
Message-ID: <20101208033910.GA4065@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20101208033910.GA4065%40sigill.intra.peff.net
In-Reply-To: <alpine.DEB.2.00.1012071652160.662@asgard.lang.hm>

```
On Tue, Dec 07, 2010 at 04:52:48PM -0800, david@lang.hm wrote:

> >Won't "git add -A; git commit" do what you want?
> 
> it very well may, I'll have to upgrade git on that box to a version
> that supports it.

It was introduced in 1.6.0. If you have something older, "git add -u &&
git add ." will do the same thing.

-Peff

```
