How do I branch an individual file in SVN?

Posted by Michael Carman on Stack Overflow See other posts from Stack Overflow or by Michael Carman
Published on 2008-09-22T20:29:13Z Indexed on 2010/03/29 4:23 UTC
Read the original article Hit count: 278

Filed under:
|
|

The subversion concept of branching appears to be focused on creating an [un]stable fork of the entire repository on which to do development. Is there a mechanism for creating branches of individual files?

For a use case, think of a common header (*.h) file that has multiple platform-specific source (*.c) implementations. This type of branch is a permanent one. All of these branches would see ongoing development with occasional cross-branch merging. This is in sharp contrast to unstable development/stable release branches which generally have a finite lifespan.

I do not want to branch the entire repository (cheap or not) as it would create an unreasonable amount of maintenance to continuously merge between the trunk and all the branches. At present I'm using ClearCase, which has a different concept of branching that makes this easy. I've been asked to consider transitioning to SVN but this paradigm difference is important. I'm much more concerned about being able to easily create alternate versions for individual files than about things like cutting a stable release branch.

© Stack Overflow or respective owner

Related posts about version-control

Related posts about svn