tags:

views:

402

answers:

8

I'd like to make a private branch of a public svn repository.

By this, I mean that there's a public, open source (codeplex) repository that I need to make my own, custom changes to. These changes wouldn't be accepted back into the tree. I want to:

  • Check in the changes I make into my own source control, so that they're saved and versioned.
  • Keep some link with the original so that I can easily merge "official" changes.

I understand that git can do this, but I can't figure out how to do it with SVN.

If not possible, how do I do some aspect of the above -- something like taking the code completely over within my repository and keeping a "clean" copy of the official tree where I can easily diff the two trees?

Thanks, James

A: 

I think you've answered your own question, twice.

Use DVCS or keep a clean copy and merge into you own svn repo.

basszero
+5  A: 

Google git-svn. Works well for me.

Rhythmic Fistman
+1  A: 

You export the revision you want to branch from, import it into your own repository, and work on that. Later you can merge the difference between the original imported revision and the head into the main repo.

Yeah, it's a crutch. Why don't you try git-svn?

sbi
+1  A: 

You can't. I've seen this issue worked around in two different ways:

  1. Use a DVCS with SVN integration like bzr-svn or git-svn. These integrations are expressly designed for the case where you want to keep local branches but still be able to interact with the upstream source via SVN.

  2. Use Piston. Piston automates the process of adding a vendor source tree to your project so you can make your own changes, and periodically pulling and merging updates from the source repo.

Avdi
+7  A: 

The best solution for this problem is the one described in Version Control with Subversion in the section vendor branches. Use the SVN export command to dump a snapshot of the external SVN hosted project to your local SVN workspace as a vendor drop.

Stephen C. Steel
+1  A: 

One tool that can help is svnsync (though moving to a DVCS as others have suggested may in fact be preferable).

Alex Martelli
A: 

Another tool is tailor (http://wiki.darcs.net/Tailor). It can move changes between many types of repositiories. If you are used to subversion, you can even make a local svn server with changes from upstream and with your private changes, updating local server with codeplex's changes as they come.

liori
+1  A: 

As said by others, using a distributed version system that works with Subversion is probably your best bet. An alternative to git is Mercurial and one of its options, hgsubversion or hgsvn. It's really a personal choice between the two but Mercurial may be preferable if you are a regular Subversion user. It has a command line that is similar to Subversion and, if you are on Windows, TortoiseHg which is similar to TortoiseSVN.

Steven Lyons