threads / discuss / 24394

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

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

## tl;dr

3 messages between Jul 14, 2010 and Jul 14, 2010.

replies: 2people: 2as markdown or json

Tikhon Tarnavski· Jul 14, 2010, 15:46 UTC · lore
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· Jul 14, 2010, 16:15 UTC · re: Tikhon Tarnavski · lore

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

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.
Тихон Тарнавский· Jul 14, 2010, 16:58 UTC · re: Jonathan Nieder · lore

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

On Wed, 14.07.2010 11:15:08 , Jonathan Nieder wrote:
Show 8 quoted lines
> 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.

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

← back to recent threads