Re: Converting from svn to git
- From
- David Neu <david@davidneu.com>
- Date
- Aug 11, 2008, 17:46 UTC
- Message-ID
- <e0b44a890808111046q2626defdnab31b0d7b1c4578@mail.gmail.com>
- In-Reply-To
- <e0b44a890808100848p367f5c66qfa21cba1b3ba12a0@mail.gmail.com>
OK, I did
$ git-filter-branch --tree-filter 'rm -rf subdir1/ subdir2/ subdir3/' -- --all
which looks good, except when I open gitk, I still see "empty" commits that correspond to subdir1/, subdir2/ and subdir3/.
Is there anyway to remove those?
Many thanks!
Cheers, David
On Sun, Aug 10, 2008 at 11:48 AM, David Neu <david@davidneu.com> wrote:
Show 35 quoted lines
> That's great - thanks to everyone!
>
> On Sun, Aug 10, 2008 at 11:32 AM, Michael J Gruber
> <michaeljgruber+gmane@fastmail.fm> wrote:
>> David Neu venit, vidit, dixit 10.08.2008 16:54:
>>>
>>> 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
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>