SVN onlinux
Subtopics
Install SVN
On debian, just do aptitude install svn
Create an initial repository
For me, I'll create the repo in /home/svnrepo and the Linux group developers will have access to this repo:
mkdir -p /home/svnrepo
svnadmin create /home/svnrepo
chgrp -R developers /home/svnrepo
chmod -R g+w /home/svnrepo
Now create an initial directory in the repository.
$ mkdir -p /tmp/r/trunk /tmp/r/branches /tmp/r/tags
$ cd /tmp/r
$ svn import . file:///home/svnrepo -m "Initial directory structure"
To make sub directories, you can do that with the previous import, or add them later on:
$ mkdir scripts
$ svn import . file:///home/svnrepo/trunk -m "scripts go here"
Check out trunk/scripts
$ svn co file:///home/svnrepo/trunk/scripts my_scripts
$ ls
my_scripts
Add files and commit:
cd my_scripts
cp /some/path/mysqldump.sh .
svn add mysqldump.sh
svn commit .
<You will be prompted for entering comments>
Checking out files again
$ rm -Rf ./my_scripts
$ svn co file:///home/svnrepo/trunk/scripts my_scripts
<you will find mysqldump.sh in my_scripts, so svn ci/co has been verified>
Subversion commands:
co/checkout Check out a copy of the source code to a working copy.
ci/commit Commit your local changes to the repository
up/update Update your working copy to reflect changes to the repository since your last update
status New in Subversion - summarise your local changes, without talking to the repository, or summarise resources that are out of date without updating.
add, remove/rm Add or remove files to/from version control.
copy/cp, move/mv New in Subversion - copy/move a file or directory to another file, keeping old version history.
merge Equivalent to cvs update -j - merge changes from another location into the working copy.
switch Change your working copy to use another branch
diff Get differences between your working copy and the last updated sources (new to Subversion), or the current repository
log Show log entries for resource
propadd, proplist, propdel, propviewi New to Subversion - manipulate metadata on a file. You can associate arbitrary data to any file or directory. A certain number of metadata keys have a special meaning (for example, svn:mime-type).
Other examples
Showing version comments on a file
$ cd my_scripts
$ svn log --verbose mysqldump.sh
Tag a project in trunk - tag is a snapshot of a project
$ svn copy file:///home/svnrepo/trunk/scripts file:///home/svnrepo/tags/scripts/release-1.0 -m "Tagging release 1.0 of scripts"
Create a new branch from the trunk
$ svn copy file:///home/svnrepo/trunk/scripts file:///home/svnrepo/branches/scripts/unix -m "Create a UNIX branch"
$ svn copy file:///home/svnrepo/trunk/scripts file:///home/svnrepo/branches/scripts/linux -m "Create a Linux branch"
There are no comments on this page. [Add comment]