SVN Usage

SVN Properties

Line Endings

When you check files out of SVN it can update the line endings for you. In "native" mode it will give CR/LF line endings on Windows and LF line endings on *nix. If you want to force a line ending, set it with this command:

svn propset svn:eol-style LF myfile.c


If a file is an executable and you don't want SVN to change the line endings, tag it as an executable with this command:

svn propset svn:executable ON somescript

SVN Externals

If you want to chain checkouts together, use the SVN external property. Do this while in the directory in which you want the new checkout to appear:

svn propset svn:externals 'commonFiles' .

Checking out a sparse tree

Sometimes you only want to check out parts of a large SVN tree. You can do that one checkout at a time, but then the checkouts are not all tied together (for instance, you could not "svn up" the whole tree).

mkdir myLocalRepo
cd myLocalRepo
svn checkout --depth=files
cd trunk
svn up tree3
svn up tree5
svn up tree9

Now you have an SVN local copy of a sparse part of the main repo. If you want to add more to it, just repeat the above steps.

cd myLocalRepo
svn checkout --depth=files
cd branches
svn up branch6

 Since the "myLocalRepo" directory is linked to the SVN repo, you can go to that directory and type "svn up" and update the entire checked out sparse tree (without it pulling down the portions you have not yet checked out).


Popular posts from this blog

Patching VMware Tools in Fedora 18

Programming language notes, links

Questions to ask about yourself, your job, your company