Thu, 10 Aug 2006

Subversion: new project/repository configuration and some basic commands

As root:
    svn mkdir /var/svn/repo/newproject
    chown -R myUser:svnusers /var/svn/repo/newproject
    (presumes you have a svnusers group)

As a user/owner (myUser) of the newproject:
    svnadmin create /var/svn/repo/newproject

As root:
    chown -R myUser:svnusers /var/svn/repo/newproject
    chmod 664 /var/svn/repo/newproject/db/*

As a user/owner (myUser) of the newproject:
    cd /tmp
    mkdir -p newproject/trunk
    mkdir -p newproject/branches
    mkdir -p newproject/tags

    cd /tmp/newproject/trunk
    cp -pvr /home/newproject/www .

    svn import /tmp/newproject file:///var/svn/repo/newproject -m "initial import"

    cd /tmp
    rm -rf newproject/

To verify results of the import:

    svn list --verbose file:///var/svn/repo/newproject

To export the project without .svn files

    cd [to target export directory]
    svn export file:///var/svn/repo/newproject/trunk/www [option name]

To checkout the project with .svn files

    cd [to target working copy directory]
    svn checkout file:///var/svn/repo/newproject/trunk/www [option name]

svn status [file:///var/svn/repo/newproject]
    prints the status of working copy files and directories

svn diff
    shows changes to the working copy

svn update [file:///var/svn/repo/newproject]
    brings changes from the repository to your working copy
        A == added
        D == deleted
        U == updated
        C == conflict
        G == merged

svn add PATH
    adds files/directories to your working copy and schedules them for
    addition to the repository.  will be uploaded and added to the repository
    during the next commit.  when adding a directory, the default behavior is
    to recurse

svn delete PATH
    schedules PATH for deletion on the next commit.  if PATH is a URL, it will
    immediately delete and a log message must be supplied.  

svn copy SRC DST
    copy a file/directory in your working copy or repository.

svn move SRC DST
    move a file/directory in your working copy or repository.  equivalent to
    svn copy/svn delete.  

    example:  svn move foo.c bar.c

svn commit [--message] [PATH]
    sends changes from working copy to the repository.  alias == ci.

    example:  svn commit -F message foo.c
        this only commits the foo.c file and a message

    svn commit without any args will commit everything

svn log [PATH]
    display all of the commit messages

Posted at: 21:27 | category: /dev | Comments ()