views:

281

answers:

2

Sites like github, bitbucket provides an excellent/useful feature of "forking" projects. This allows one to simply fork a project and work on their desired features (before submitting it to the projector owner and getting commit access).

How is this workflow best achieved for SVN projects (especially the various ones hosted on Google Code that are still using SVN)?

Clarification: I know about svn diff, but want a solution where I can do several intermittent commits before submitting the changes back to the author (the owner of the SVN repo). Bonus points for making this "fork" as easy as clicking a button (I wonder if github/bitbucket will ever have this feature of automatically cloning a SVN repo).

+1  A: 

How is it achieved? The same way it's always been, you young whippersnapper!

Why, in my day, after walking home from school (uphill, in the snow), we had to create a diff of our changes and submit it to the maintainer (or maintainer's mailing list/group) manually!

You'll find the command svn diff to be of use to you in this task. It will create a unified diff of your changes suitable for submission upstream.

Charles
+1 for greybeard
eyelidlessness
Forking a DVCS enables one to do intermittent commits. Whereas relying on 'svn diff' alone is to leave one's working copy vulnerable (eg: disk crash).
Sridhar Ratnakumar
Indeed, but that is a function of the process forced by the toolset. You can't make an apple taste like an orange, no matter how much paint you apply.
Charles
+3  A: 

Since you already seem to be familiar with git, you can use git svn. You can fetch the SVN project like this (-s indicates the standard trunk/branches/tags layout):

git svn clone url://path/to/repo -s

You can push each local git commit as a separate svn commit like this:

git svn dcommit

It is common practice to use the git rebase command to clean up and simplify the commit history before pushing changes to svn.

edit: for mercurial there are also several extensions to interoperate with an SVN repository, though none appear to be as mature as git-svn.

Wim Coenen
I am more familiar with hg.
Sridhar Ratnakumar
Sridhar: Don't worry if you're more familiar with Mercurial -- give hgsubversion as try and see if it works for you: http://bitbucket.org/durin42/hgsubversion/ People use it daily, please come ask in #hgsubversion on irc.freenode.net.
Martin Geisler