Bostone
Bostone

Reputation: 37126

SVN replicate directory

Is it possible (or even practical) to copy directory from one SVN repository location to another, retaining tho old one and keep history for each individual file in both places? So far I see SVN import which copies the directory but looses the history or SVN move which relocates the directory. Here's a brief example:

Upvotes: 0

Views: 344

Answers (4)

CodeGoat
CodeGoat

Reputation: 1196

I think plain old SVN copy does this, and then allows you to diverge. It's the same as branching/tagging.

If you want something like a link without diverging code, look into using an externals definition, as described in the SVN book:

http://svnbook.red-bean.com/en/1.5/svn.advanced.externals.html

Upvotes: 1

Daniel F. Thornton
Daniel F. Thornton

Reputation: 3685

  • You are correct: svn import is not perfect, as addressed in the SVN FAQ and in SVN Issue 1328.
  • You may also be looking for svn move.

  • Also, see this thread (related question with similar suggestions).

Upvotes: 0

kdgregory
kdgregory

Reputation: 39606

Are you looking for the equivalent of a Unix link, where the files are updated simultaneously? Or are you looking to copy them and let them diverge? I think that svndump and svnfilter (or hand-editing) could probably do the latter.

However, I'd suggest taking some time to think about why you're doing this, as it seems to me to lead to maintenance headaches. If you're trying to keep two files that update simultaneously, a better solution is to extract them into a new module that is linked with the code that uses it. If you're trying to let them diverge ... well, to be honest, history doesn't make a lot of sense there, and could give a false view of the way the repository looked at a point in time.

Upvotes: 3

Jason Musgrove
Jason Musgrove

Reputation: 3583

Would using svn copy work?

Upvotes: 4

Related Questions