Revision 2 as of 2008-10-30 11:40:33

Clear message

URL

{{{ svn co https://svnsrv.desy.de/desy/openafs-osd }}}

Common usage

Updating local copy before starting to work {{{ cd openafs-osd/trunk svn up}}}

To find out about local modifications: {{{ svn status -q }}}

To see recent changes {{{ svn log --limit=10 }}}

Check in quickly {{{ svn ci -m "my comment" }}}

Check in thoroughly {{{ svn ci }}} Opens an $EDITOR for you to input a comment. (!) Shows a list of changed files and allows you to abort by leaving the editor without saving.

Other uses

Viewing the log

svn 1.4.2 has been known to create insufficient log output in cases. Apparently it helps then to specify the (default) revision range: {{{ svn log -r HEAD:1 }}}

Creating a branch

{{{ svn mkdir branches/new-branch svn copy trunk/openafs-1.4.7 branches/new-branch/ svn ci -m "created new-branch" }}}

It is often desirable to branch an earlier revision of the trunk or another branch: {{{ svn copy -r 12 trunk/openafs-1.4.7 branches/newer-branch }}}

Including changes into branches

{{{ svn merge -r 12:15 trunk/ branches/newer-branch/ }}} which can alternatively be written as {{{ svn merge trunk@12 trunk@15 branches/newer-branch }}} and that's more intuitive at times.

Don't forget {{{ svn ci -m "+ merged in changes between 12:15" }}} (keywords like "merge" or ":" in log messages can help later when grepping can become necessary, but not to my personal experience.)

Rolling back to earlier revisions

{{{ svn merge -r 15:12 . . }}} or {{{ svn merge .@15 .@12 . }}} which in both cases means "compare . in revision 15 with . in revision 12 and apply the changes to file/directory ."

When commit fails

...because some files are outdated, it can be harmful to just "svn up" because that may bring files into conflict states that are difficult to resolve, and svn <!> cannot automatically undo that.

You can undo all local changes, but you would-be checkin is <!> lost then, too: {{{ svn revert . -R }}}

It can be wise to back up local changes before updating: {{{ svn export . /tmp/my-checkout }}} If things go haywire, use revert and then copy your files back from the export. You cannot svn import them, as that servers a different purpose.

Resolving conflicts

Should conflicts occur, after resolving them (as in CVS), one must tell SVN that they are in order again: {{{ svn resolve openafs-1.4.7/src/fsint/afsint.xg }}} Only then will svn commit be allowed.