Mirror a remote repository in a local branch

The vendor branches section of the book was written before Subversion grew 
support for foreign repository merges. If I was rewriting that section now, 
I would absolutely mention this feature.

1. 'svn export' the remote branch.

2. 'svn import' the branch stuff into your own repository. Actually, I'd 
recommend doing a local 'svn add' and 'svn commit' so you have the chance to 
make sure the properties on the files and directories match those in the 
foreign repository (see below). In either case, record the version of the 
remote code that you're importing.

3. Make your customizations as normal, cimmit, etc.

4. When you need to sync up your mirror, just use:

    $ svn merge FOREIGN-URL_at_MIRRORED-REV \ 
                FOREIGN-URL_at_HEAD \ 
                mirror-working-copy

    (where MIRRORED-REV was the revision of the code you imported or 
    last merged, of course).

It has some gotcha:

   * renames in the foreign repository can really interfere with the merges 
     that bring them into your own repository.

   * you have to make sure that when you make your initial import of the 
     remote code that your auto-props don't set props on the files in your 
     repository differently than they are in the remote one (or you run the 
     risk of future conflicts)

   * there's no merge tracking support.

But I use this feature myself to maintain vendor branches, and I've been 
pretty happy with the results. 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值