git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Remove all files except a few files, using filter-branch
@ 2012-09-16 16:28 Yi, EungJun
  2012-09-16 17:06 ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Yi, EungJun @ 2012-09-16 16:28 UTC (permalink / raw)
  To: git

Hi, all.

I want to remove all files except a few files, in the history of my
git repository.

I tried to do that as follows:

    git filter-branch --index-filter "git rm --cached --ignore-unmatch
$(git ls-files | grep -v '^filename$' | tr '\n' ' ')"

But this does not work well if there is a file whose name is not
encoded in us-ascii or includes parenthesis. git-filter-branch is
great to remove some files in my repository, but not good enough to
remove all except only a few.

Does anyone know the better way?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-18 15:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-16 16:28 Remove all files except a few files, using filter-branch Yi, EungJun
2012-09-16 17:06 ` Andreas Schwab
2012-09-18 15:01   ` Yi, EungJun
2012-09-18 15:10     ` Johannes Sixt
2012-09-18 15:25       ` Yi, EungJun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).