Re: Converting from svn to git
- From
Michael J Gruber <michaeljgruber+gmane@fastmail.fm>
- Date
- Aug 10, 2008, 15:32 UTC
- Message-ID
- <g7n1mk$67t$1@ger.gmane.org>
- In-Reply-To
- <e0b44a890808100754l536bc4f3kfd953b52044f6e59@mail.gmail.com>
David Neu venit, vidit, dixit 10.08.2008 16:54:
Show 14 quoted lines
> Thanks for the reply - this looks like what I'd need, but > I can't see how to keep the contents of the base dir and > lose the subdirs, e.g. > > $ git-filter-branch --subdirectory-filter . HEAD > > removes all subdirs and the contents of the base dir. > > So, I figure I'd remove each subdir, using > > $ git-filter-branch --tree-filter 'rm -rf subdir1/' HEAD > > but this complains if subdir1 contains subdirectories, it > says: Namespace refs/original/ not empty
It complains because filter-branch stores the original refs in that namespace, and on the second filter-branch run it wants to do this again. You can avoid this by using the "-f" option to filter-branch, or by removing all subsirs in one go ("rm -rf subdir1 subdir2..."). Also, you might want to rewrite all refs ("--all"), not just HEAD.
Michael