SubVersionCookBook

WebHome | UnixGeekTools | Geekfarm | About This Site

Pointers

initial import

    mkdir /path/svnroot
    svnadmin create /path/svnroot/myproject
    svn import mytree file:///path/svnroot/myproject/trunk
    mv mytree mytree.bak
    svn co file:///path/svnroot/myproject/trunk myproject

    svn mkdir file:///path/svnroot/myproject/tags
    svn mkdir file:///path/svnroot/myproject/branches

properties


    # some commonly used properties
    svn propset svn:executable ON somescript
    svn propset svn:mime-type image/jpeg foo.jpg

    # set a custom property
    svn propset owner sally foo.c

    # change previous commit log message
    svn propset --revprop -r 25 svn:log "Journaled about trip to New York."

Shared repository svn+ssh

Make sure that:

create a repository

dump and load


    svnadmin dump /home/rafael/svn | gzip -9 > dump.gz
    gunzip -c dump.gz | svnadmin load /home/rafael/svn

    svnadmin dump /path/to/reponame > /tmp/reponame.dump
    scp /tmp/reponame.dump user@server.domain.com:/tmp/
    svnadmin create /path/to/reponame
    svnadmin load /path/to/reponame < /tmp/repo1.dump
    chown -R svn:svnusers /path/to/reponame ; chmod -R g+w /path/to/reponame/db/

hook emails

Commands

Ignoring files


    # launch an editor to edit ignore patterns, one per line
    svn propedit svn:ignore .

    ~/.subversion/config
    [miscellany]
    global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store *.log *.aux *.bbl *.blg *.dvi

Converting a directory to a subversion archive in-place


    $ cd /path/to/project/
    $ svn mkdir proto://server/svn/project/trunk
    $ svn checkout proto://server/svn/project/trunk .
    $ svn add *
    $ svn commit

Externals


    svn co svn://host/project1/trunk project1
    svn propset svn:externals "project2 svn://hostname/project2/trunk" project1

Patches


    # create a patch file
    svn diff > mychanges.patch

    # apply the patch file in same directory it was created
    patch -p0 -i mychanges.patch

Merging





Updated Sat Oct 7, 2006 12:52 PM