René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
Subversion | ||
Subversion is a tool for version control. It is a ground-up rewrite of
CVS with many advantages.
Here's the online book "Version Control with Subversion".
Subversion's HomepageAvailable subcommandsaddblame (praise, annotate, ann)catcheckout
co is an abbreviation that can be used instead of checkout.
On windows, the following syntax can be used for the file protocol:
svn checkout file:///C:/path/to/repository
Checking out a repository creates a local copy of it, containing the HEAD revision.
checkout is an initial action, probably only needed once per repository. After having checked out a repository, you wil most probably use update. cleanupcommit
ci is an abbreviation that can be used instead of commit.
After commiting a file into the repository, other users will see this 'latest' verson
of the commited file.
A commit increases the version number.
copy (cp)
co is an abbreviation that can be used instead of copy.
delete
del, remove and rm are abbreviations that can be used instead of delete.
diff (di)
This command is one of the three to examine changes.
Creating patch files:
svn diff > patch_file exporthelp
? and h are abbreviations that can be used instead of help.
svn help <subcommand> shows options about subcommands.
importinfolist (ls)logmergemkdirmove
mv, rename and ren are abbreviations that can be used instead of move.
propdel (pdel, pd)propedit (pedit, pe)propget (pget, pg)proplist (plist, pl)propset (pset, ps)
Used to set a property.
resolved
Removes the three temporary files
revert
This command is one of the three to examine changes.
Overwrites the file with the pristine version
status
stat and st are abbreviations that can be used instead of status.
This command displays the states of the files in the working directory.
This command is one of the three to examine changes.
switch (sw)update
up is an abbreviation that can be used instead of update.
Updating a file or files sort of synchronizes changes on that file with changes other users made on that file. That is, it, update brings the
(local) working copy into
A repository must be checked out befor any changes, updates and the like can be made on it.
updating a repository is therefor usually the first step in a work cycle.
Basic Work CycleUpdate your working copyMake changesExamine your changesMerge others' changesCommit your changesRepositoryCreating
svnadmin create path/to/repos
Working copyWorking directory
Subversion records two pieces of information (within .svn/ about each file within the working directory:
A file within a working directory has one of the following four states:
.svn
Also called the administrative area.
Each directory in a working directory contains a .svn directory.
.svn is also used in order to determine which files need to be updated.
Version numbers
Version numbers apply to entire trees, not to individual files. This implies that version V and W of a file do not necessarily differ (which is
different from how CVS handles it.
It is helpful to think of version number N as to the state of the repository after the
Nth commit.
Revision
A revision is a snapshot of the repository of a particular moment in time.
Revisions can be specified using the --revision (or -r) switch.
Revisions can also be referred to with date in curly braces: --revision {2002-08-28} or --revision {"2002-08-28 22:21"}. Note, {2002-08-28} referres to as {"2002-08-28 00:00"}, which might lead to some unexpected results. ASE Revision
A BASE revision is the version of the last update, also called pristine copy. It is stored in the .svn directory.
The idea behind the pristine copy is to make it possible to quickly (that is, without contacting the repository on the server) a diff, status and revert HEAD Revision
The latest revision in the repository
COMMITED Revision
The latest revision in the repository
PREV RevisionConflicts
Conflicts can be detected with the update command. When Subversion detects a conflict in a file,
it places conflict markers into the file (to allow the user to find the places of the conflict) and creates the following three files in the directory:
Resolving conflicts
Conflicts can be resolved by doing one of the following three things:
|