[OT] Anyone w/ svn->git experience and advice?

Jacob Carlborg doob at me.com
Fri Jan 13 05:46:25 PST 2012


On 2012-01-13 14:35, Michel Fortin wrote:
> On 2012-01-13 12:12:09 +0000, Jacob Carlborg <doob at me.com> said:
>
>> On 2012-01-13 10:04, Nick Sabalausky wrote:
>>> "Jacob Carlborg"<doob at me.com> wrote in message
>>> news:jeont0$1bkp$1 at digitalmars.com...
>>>>
>>>> If --preserve-empty-dir isn't working, can't you add these directories
>>>> after you've cloned the repository?
>>>>
>>>
>>> I suppose it might be possible since git seems to be big on allowing
>>> history
>>> rewrites, but I know next-to-nothing about how to actually do it :/
>>
>> I see no reason to rewrite the history. Just clone the svn repository,
>> add the missing directories, add a .gitignore file to each of the
>> directories so git will keep them and then make a new commit.
>
> But if you do that you won't have .gitignore files in all the SVN
> revisions you fetched, so older revisions will be broken.

True, didn't think of that.

> What can be done is add the .gitignore files to all the revisions, like
> this:
>
> git filter-branch -f --tree-filter 'mkdir -p directory; touch
> directory/.gitignore' -- --all
>
> Of course this will add the directory to all commits in all the branches
> of the repository, whether or not the directory was present in the SVN
> repository.

There's always a problem :)

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list