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

Nick Sabalausky a at a.a
Fri Jan 13 13:23:46 PST 2012


"Michel Fortin" <michel.fortin at michelf.com> wrote in message 
news:jepbuq$2m7c$1 at digitalmars.com...
> 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.
>
> 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.
>

Ahh, now I like that! It does, of course, mean that old revisions will be 
cluttered with unnesessary hidden files, and I'll need a commit to get rid 
of them going forward, but that's a *lot* better than the other way around 
(leaving them missing in the history and then adding them after the fact). 
"Works for me." I'll try it...




More information about the Digitalmars-d mailing list