Table of Contents

Middleware

Subversion(svn)



Web Sites


Command

Importing Files and Directories

The svn import command is a quick way to copy an unversioned tree of files into a repository

Command Explanation Example
svn important Commit an unversioned file or tree into the repository. svn import /tmp/test svn://192.168.0.100:3690/svn/test -m "first"
svn import C:/tmp/test file:///C:/svn_repo/test1 -m "first"
svn import --username user01 --password pass01 /home/test/test_dev svn://192.168.0.100:3690/home/svnrepo/test_dev  -m  "first import"

Change Work (from checkout to checkin)

Command Explanation Example
svn checkout
svn co
Check out a working copy from a repository. svn checkout svn://192.168.0.5:3690/home/svn/test /home/svn/test
svn status
svn st
Print the status of working copy files and directories. svn status
svn update
svn up
Update your working copy. svn update
svn resolved Remove “conflicted” state on working copy files or directories.
svn add Add files, directories, or symbolic links. svn add test1.txt
svn add * --force
svn delete
svn del
svn rm
Delete an item from a working copy or the repository. Method1 (delete local file and commit)
svn delete DIR1/
svn commit -m “delete”

Medhod2 (directroy delete repogitory files)
svn delete svn://192.168.0.5:3690/home/svnrepo/test/test2
svn copy
svn cp
Copy a file or directory in a working copy or in the repository.
svn move
svn mv
Move a file or directory.
svn mkdir Create a new directory under version control.
svn diff
svn di
This displays the differences between two revisions or paths.
svn revert Undo all local edits. svn revert --recursive .
svn commit
svn ci
Send changes from your working copy to the repository. svn commit -m “memo”

Etc

Command Explanation Example
svn help
svn h
Help!
svn log Display commit log messages.
svn list svn ls List directory entries in the repository.
svn list svn://user1@192.168.0.1/home/svn/xxx/
svn cat Output the contents of the specified files or URLs. svn cat http://svn.red-bean.com/repos/test/readme.txt
svn cat -r 3 http://svn.red-bean.com/repos/test/readme.txt
svn copy Copy a file or directory in a working copy or in the repository.
svn merge Apply the differences between two sources to a working copy path.
svn info Display information about a local or remote item.
svn switch Update working copy to a different URL.


svnadmin

Command Explanation Example
svnadmin create Create a new, empty repository.
svnadmin verify Verify the data stored in the repository.
svnadmin hotcopy Make a hot copy of a repository.

svnlook

Command Explanation Example
svnlook youngest Print the youngest revision number.


Operation Example

Create Repository

mkdir -p /home/svn/testrepo
cd /home/svn/testrepo
svnadmin create project1
#check
svnlook info /home/svn/testrepo/project1
svnlook youngest /home/svn/testrepo/project1

Import

mkdir /tmp/work
cd /tmp/work
mkdir trunk tagas branches
svn:///home/svn/testrepo/project1/ -m ""
svn import /tmp/work file:///home/svn/testrepo/project1/ -m ""

#check
svnlook info /home/svn/testrepo/project1
svnlook youngest /home/svn/testrepo/project1
#Import Example#
svn import test svn://192.168.0.100:3690/home/svnrepo/test -m ""
svn import --user USER1 --password PASSWORD /tmp/work/testdir2 file:///home/svnrepo/test/test2 -m "import"

Check out

svn checkout file:///home/svn/testrepo/project1 /tmp/work1
cd work1

svn info
svn list

svn status
echo "test" >> test.txt
svn diff
svn status
svn commit -m "Add test.txt."
#Check out Example#
svn checkout file:///home/svnrepo/test/test2 /tmp/work
svn checkout svn://192.168.0.10:3690/home/svnrepo/test testproject

Daily work

svn status
svn update
svn status

vi test2.txt
svn add test2.txt
svn delete test.txt

svn diff
svn status
svn commit -m "work"


Backup

svnsync

Backup Server

check ssh login with no password.

apache@backup-server# ssh active-server
apache@backup-server# svnadmin create test
apache@backup-server# echo  '#!/bin/sh' >> test/hooks/pre-revprop-change
apache@backup-server# echo  'exit 0'   >> test/hooks/pre-revprop-change
apache@backup-server# chmod +x test/hooks/pre-revprop-change
Active Server

Warning: Destination and Source. “svnsync init DestinationREPO SourceREPO”

apache@active-server# svnsync init file:///home/svnbackup/test svn+ssh://apache@192.168.0.10/home/svn/test

apache@active-server# svnsync sync file:///home/svnbackup/test
apache@active-server# svnlook youngest /home/svnbackup/test