This directory is under version control - Tell me about the code?
svn info
Lists the repository URL (see below), the checked out
revision number etc.
What's available on the repository server?
svn list URL
URL is something like http://myhost.com:/svn-repos, where svn-repos is
the path to the repository on the server, assuming you're serving svn
via Apache. This lists the top level directories.
Who's done what lately?
svn log
Lists the commit comments (in reverse order).
Check out the directory 'Module'
svn checkout URL/Module
Note: This does not lock Module. Others may do the same as you
and cheerfully make inconsistent changes. These are resolved by
one or other of you on commit.
Check out directory Module but call it MyModule
svn checkout URL/Module MyModule
Get directory Module out for distribution, not for editing
svn export URL/Module ModuleReleaseName
Update your checked out copy to the latest version (pull latest
version from
the server).
svn update
Note: this only updates files at or beneath your current directory
level.
Commit your changes (send your changes to the
server for others to see).
svn commit [files to commit] [-m 'my message']
Leaving out the message means the value of shell variable SVN_EDITOR
will pop up for your message (or the system's default editor).
Leaving out the file list means everything uncommitted is committed.
Resolving conflicts:
See http://svnbook.red-bean.com/en/1.1/svn-book.html#svn-ch-3-sect-5.4
Add a new project (with existing files) to a repository. This
will create a new branch in the repository, even with multiple
subdirectories.
svn import thisdir URL/newdir
Note that this will not checkout
your code for you, thisdir
is not put under revision
control. For a controlled version, you need to do a seperate svn checkout.
Add a new file to directory
svn add dir/newfile.txt
Move a file from place to place
svn mv oldpos/file.txt newpos/file.txt
Adding a directory will add all its contents.
Copy a file
svn copy oldpos/file.txt newpos/samefile.txt
Remove a file
svn rm [filename]
Note: this removes the local copy for you too. If you just 'rm' a
file without 'svn rm'-ing it, just 'svn rm' it explicitly before you
commit. svn status
will flag when this needs to happen.
See what is changed, uncommitted etc.
svn status
Note: this is a cheap operation unrelated to commit. It needs no access
to a networked repository.
Examine differences you've made since you got the file from the
archive
svn diff dir/newfile.txt
Note: the above needs no access to a networked repository. If you
want to compare to something on the repository (e.g. the current
version or previous ones), see svn help diff for details. You may
actually want to use svn
merge, because that takes into
account the history of files whose names have changed.
Revert the file contents to the repository version because your
changes suck.
svn revert dir/newfile.txt
Note: This also undeletes things (assuming you used 'svn rm').
Make a new repository (On the server)
svnadmin create /usr/local/svn-repos
This creates a Berkley DB backed subversion repository. To get a
file system based on, use the '--fs-type fsfs' flag.
This only needs to be done once,
and has probably already been done for you! (Certainly if you are
using BAI)
Once your server is set up, but you have an empty repository, you want to do this:
Dump, archive and reload a repository
svnadmin dump URL/svn-repos > svn-repos-dumpfile