Академический Документы
Профессиональный Документы
Культура Документы
Home (/) > Tutorials (/TUTORIALS/) > Subversion Commands and Scripts (/TUTORIALS/Subversion.html)
Subversion Commands
and Scripts
Subversion (SVN) command summary cheat sheet, use, best
practices, tips and scripts. This tutorial covers version control with
Subversion using the command line interface, GUI clients and scripts which interface Subversion
with GUI diff tools.
(http://www.yolinux.com/)
search
| Home Page (/) | Linux Tutorials (/TUTORIALS/) | Terms (/YoLinux-Terms.html) | Privacy Policy (/privacy.html) |
Advertising (/YoLinux-Advertising.html) | Contact (/YoLinuxEmailForm.html) |
Search
http://www.yolinux.com/TUTORIALS/Subversion.html Page 1 of 21
Subversion Commands and Scripts 18/07/2017, 19*46
http://www.yolinux.com/TUTORIALS/Subversion.html Page 2 of 21
Subversion Commands and Scripts 18/07/2017, 19*46
http://www.yolinux.com/TUTORIALS/Subversion.html Page 3 of 21
Subversion Commands and Scripts 18/07/2017, 19*46
http://www.yolinux.com/TUTORIALS/Subversion.html Page 4 of 21
Subversion Commands and Scripts 18/07/2017, 19*46
First collumn:
A: File to be added
C: Conflicting changes
D: File to be deleted
G: File to be merged with
updates from server
M: File has been modified
R: File to be replaced
G: File to be merged
X: Resource is external to
repository (svn:externals)
?: File/directory not under
version control
!: File/directory missing
~: Versioned item obstructed by
some item of a different kind.
(svn 1.7+) svn relocate http://server/new- Switch your local working copy to
path mirror a new repository branch instead
(svn 1.6-) svn switch http://server/new- of main trunk or previous branch. Also
branch allows you to point your repository to a
svn switch --relocate new path on the server if the server
http://server/old-path path changes since you performed a
http://server/new-path check-out. Use "relocate" when using
Subversion version 1.7 or later.
http://www.yolinux.com/TUTORIALS/Subversion.html Page 5 of 21
Subversion Commands and Scripts 18/07/2017, 19*46
svn update -r458 filename (recusively for all files in the current
svn update --ignore-externals ./ directory and all below it). If there have
been updates to the svn repository
since you downloaded the files,
subversion will give you the
opportunity to merge. Status of files
will use the coding as stated above for
"status". Files marked with a "C"
(conflict) should be merged of
reverted. If merged then one can
perform a "resolve" and then a "check-
in".
If a file name is specified, only that file
is updated.
Can also syncronize to a specified
revision given by -r.
Use --ignore-externals to avoid the
slow processing of externals to a
potentially slow distant internet server.
Where RevisionNumber is:
Example Session:
(Assumes that the repository has already been created. For Subversion repository creation
and Subversion server configuration, see the (YoLinux Subversion and Trac tutorial
(LinuxSubversionAndTracServer.html))
Checkout: svn checkout http://svnserver/repos/svn/trunk/Project1
Go to source code directory: cd Project1/src
Edit files:
vi file1.cpp
vi file2.cpp
Verify and test: make
We are ready to check-in the files into the Subversion repository.
Check repository and report on new revisions and changes others have checked in:
svn status -u .
After many long hours or days of editing and work, get updates others have made: svn
update
U file.h
C file1.cpp
G file2.cpp
? a.out
http://www.yolinux.com/TUTORIALS/Subversion.html Page 6 of 21
Subversion Commands and Scripts 18/07/2017, 19*46
The default peg revision is BASE for working copy items and HEAD for repository URLs.
When no operative revision is provided, it defaults to being the same revision as the peg
revision.
If a peg revision is specified without an operative revision, then the operative revision is
assumed to be the same as the peg revision.
Subversion Properties:
Files under revision control can include Subversion keywords which properties can be set
with the "propset" command. Keywords are substituted with the Subversion properties and
will not appear in the file until a commit is performed. Other properties are used to modify the
behavior of Subversion.
Property Description
svn:ignore A newline separated list of file patterns to ignore. List of files/directories to be
ignored by svn status
svn:keywords Valid RCS style keywords are:
HeadURL - The URL for the head version of the object.
http://www.yolinux.com/TUTORIALS/Subversion.html Page 7 of 21