# remove all traces of some files

3 messages from 2011-04-27 to 2011-04-27. Participants: Eric Frederich, Johannes Sixt, Phil Hord.
Thread: https://gitlist.dev/t/27204

## Eric Frederich, 2011-04-27 19:58

Subject: remove all traces of some files
Message-ID: <BANLkTim_PriowuBH71M2DxxkJ=Y5oAA2uA@mail.gmail.com>
URL: https://gitlist.dev/e/BANLkTim_PriowuBH71M2DxxkJ%3DY5oAA2uA%40mail.gmail.com

```
I have been adding build files (.dll and .so files) to my git
repository periodically when I have been doing builds of my project.
I know I shouldn't be doing this and want to set up some other kind of
separate archive or something for built files.

Although there are other devs on the project, I am the only one using
Git.  Everyone else uses AccuRev.
Personally, I maintain my own Git repo (with an AccuRev git branch).

I would like to remove all traces of those .dll and .so files if I
could in my git repository.
I realize this would mess with hashes and would ultimately result in a
completely new tree.
I am fine with that since, as I said, I am the only user of this Git repo.

So, can this be done?  Can I rebuild the tree preserving commit
messages, timestamps, etc but ignoring certain files?

Thanks,
~Eric

```

## Johannes Sixt, 2011-04-27 20:37

Subject: Re: remove all traces of some files
Message-ID: <4DB87E9E.8060700@kdbg.org>
URL: https://gitlist.dev/e/4DB87E9E.8060700%40kdbg.org
In-Reply-To: <BANLkTim_PriowuBH71M2DxxkJ=Y5oAA2uA@mail.gmail.com>

```
Am 27.04.2011 21:58, schrieb Eric Frederich:
> I have been adding build files (.dll and .so files) to my git
> repository periodically when I have been doing builds of my project.
> I know I shouldn't be doing this and want to set up some other kind of
> separate archive or something for built files.
> 
> Although there are other devs on the project, I am the only one using
> Git.  Everyone else uses AccuRev.
> Personally, I maintain my own Git repo (with an AccuRev git branch).
> 
> I would like to remove all traces of those .dll and .so files if I
> could in my git repository.
> I realize this would mess with hashes and would ultimately result in a
> completely new tree.
> I am fine with that since, as I said, I am the only user of this Git repo.
> 
> So, can this be done?  Can I rebuild the tree preserving commit
> messages, timestamps, etc but ignoring certain files?

Get familiar with git-filter-branch --index-filter.

-- Hannes

```

## Phil Hord, 2011-04-27 20:40

Subject: Re: remove all traces of some files
Message-ID: <4DB87F36.9080901@cisco.com>
URL: https://gitlist.dev/e/4DB87F36.9080901%40cisco.com
In-Reply-To: <BANLkTim_PriowuBH71M2DxxkJ=Y5oAA2uA@mail.gmail.com>

```
On 04/27/2011 03:58 PM, Eric Frederich wrote:
> I have been adding build files (.dll and .so files) to my git
> repository periodically when I have been doing builds of my project.
> I know I shouldn't be doing this and want to set up some other kind of
> separate archive or something for built files.
>
> Although there are other devs on the project, I am the only one using
> Git.  Everyone else uses AccuRev.
> Personally, I maintain my own Git repo (with an AccuRev git branch).
>
> I would like to remove all traces of those .dll and .so files if I
> could in my git repository.
> I realize this would mess with hashes and would ultimately result in a
> completely new tree.
> I am fine with that since, as I said, I am the only user of this Git repo.
>
> So, can this be done?  Can I rebuild the tree preserving commit
> messages, timestamps, etc but ignoring certain files?

Something like this, perhaps:
  git filter-branch --index-filter "git rm --cached --ignore-unmatch
--quiet '*.dll' '*.so' " -- --all

More examples here:
  git filter-branch --help

Phil

```
