# how to delete from history some files, and commits with them?

3 messages from 2010-07-14 to 2010-07-14. Participants: Tikhon Tarnavski, Jonathan Nieder, Тихон Тарнавский.
Thread: https://gitlist.dev/t/24394

## Tikhon Tarnavski, 2010-07-14 15:46

Subject: how to delete from history some files, and commits with them?
Message-ID: <loom.20100714T170722-272@post.gmane.org>
URL: https://gitlist.dev/e/loom.20100714T170722-272%40post.gmane.org

```
Hello.

I'm using git for several small
projects, and now one of those pgojects
have to be divided into two independent
parts. So I want to divide git history
respectively. I can create two clones
and run filter-branch in both to delete
files. But I can't find how I may
delete empty commits after that.
Naturally, I'd prefer to do all process
automatically: removing unnecessary
files and deleting empty commits
without searching to its' hashes.

Can you suggest any solution?

```

## Jonathan Nieder, 2010-07-14 16:15

Subject: Re: how to delete from history some files, and commits with them?
Message-ID: <20100714161508.GA2330@burratino>
URL: https://gitlist.dev/e/20100714161508.GA2330%40burratino
In-Reply-To: <loom.20100714T170722-272@post.gmane.org>

```
Tikhon Tarnavski wrote:

>               I can create two clones
> and run filter-branch in both to delete
> files. But I can't find how I may
> delete empty commits after that.

Maybe --prune-empty can help.

```

## Тихон Тарнавский, 2010-07-14 16:58

Subject: Re: how to delete from history some files, and commits with them?
Message-ID: <20100714165830.GA13717@Nokia-N810-43-7>
URL: https://gitlist.dev/e/20100714165830.GA13717%40Nokia-N810-43-7
In-Reply-To: <20100714161508.GA2330@burratino>

```
On Wed, 14.07.2010 11:15:08 , Jonathan Nieder wrote:
> Tikhon Tarnavski wrote:
> 
> >               I can create two clones
> > and run filter-branch in both to delete
> > files. But I can't find how I may
> > delete empty commits after that.
> 
> Maybe --prune-empty can help.

I was forced to use git 1.5.6 (by technical reasons) where this option is
not available (and I didn't know about it). Now I can switch to 1.7 so I'll
try it soon. Thank you very much.

-- 
С уважением,
Тихон Тарнавский.

```
