threads / discuss / 27204

remove all traces of some files

Subject: remove all traces of some files

## tl;dr

3 messages between Apr 27, 2011 and Apr 27, 2011.

replies: 2people: 3as markdown or json

Eric Frederich· Apr 27, 2011, 19:58 UTC · lore

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· Apr 27, 2011, 20:37 UTC · re: Eric Frederich · lore

Re: remove all traces of some files

Am 27.04.2011 21:58, schrieb Eric Frederich:
Show 17 quoted lines
> 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· Apr 27, 2011, 20:40 UTC · re: Eric Frederich · lore

Re: remove all traces of some files

On 04/27/2011 03:58 PM, Eric Frederich wrote:
Show 17 quoted lines
> 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

← back to recent threads