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

Executables


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 http://svn.url.com/src/trunk' .


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 https://my.repo.com/trunk --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 https://my.repo.com/branches --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).


Comments

Popular posts from this blog

Patching VMware Tools in Fedora 18

Installing Fedora 18 in a VMware Fusion VM

Setting up gdb in Fedora