質問

Suppose a remote SVN repository has this structure:

/project
        /src
        /bulk

Now for some reason I already have a copy of bulk (assumed unchanging or rarely changing) elsewhere on my machine. Can I somehow checkout a new copy of the repository, but pre-provide the bulk directory so it doesn't get downloaded again?

To clarify, this hypothetical process should certainly check the checksums on the files in the bulk directory and update those files which aren't correct, so that ultimately I'll have a complete, consistent checkout. I just want to shortcut past downloading those files which I already have verbatim.

役に立ちましたか?

解決

  1. Checkout /project, specifying the depth to be 'empty'.
  2. Update /project/src specifying infinite depth.
  3. Copy your current bulk working copy into the project directory working copy.

e.g.

svn checkout --depth empty http://svnserver/project/ project
svn update --set-depth infinity project/src
// copy your current /bulk into /project

Note - this takes advantage of the sparse directories feature introduced in Subversion 1.5.

他のヒント

Instructions when using TortoiseSVN 1.7 and newer:

  1. "SVN Checkout" to /project, specifying "Checkout Depth" as "Only this item"
  2. "SVN Checkout" to /project/trunk, specifying "Checkout Depth" as "Fully recursive"

Last time I had to do this, I had an enormous number of demo files in a directory, and I just moved these to a new directory out of trunk.

You might consider doing something similar, and adding bulk to svn:ignore, if you need bulk to be in the same directory.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top