- Cheat Sheet and Example is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools









Web Sites


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:// -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://  -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:// /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://
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”


Command Explanation Example
svn help
svn h
svn log Display commit log messages.
svn list svn ls List directory entries in the repository.
svn list svn://user1@
svn cat Output the contents of the specified files or URLs. svn cat
svn cat -r 3
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.


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.


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
svnlook info /home/svn/testrepo/project1
svnlook youngest /home/svn/testrepo/project1


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 ""

svnlook info /home/svn/testrepo/project1
svnlook youngest /home/svn/testrepo/project1
#Import Example#
svn import test svn:// -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:// 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 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@

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

middleware/version-control/svn/index.html.txt · Last modified: 2018/02/06 by admin

Page Tools