sonia hamilton – linux, brazilian jiu jitsu

9 October 2007

Subversion Cheatsheet

Filed under: Uncategorized — Sonia Hamilton @ 04:28
Tags: , ,

Quickstart

sudo aptitude install subversion
svnserve -d

Create source project, splitting into trunk, tags and branches (latter 2 directories initially empty). project is a dummy name that is just used to build repo, so actually use the name project, original is the name of the original code directory.

mkdir -p project/{trunk,tags,branches}
mv ~/original ~/project/trunk

Using trunk/tags/branches for a small project is overkill – tags and branches can be added later. Therefore for a small project, just do:

mkdir -p project
mv ~/original ~/project

Create subversion repository:

cd
svnadmin create svnrepo

Import project into repository, and archive original data:

svn import project file:///home/sonia/svnrepo -m "initial import"
mv project /tmp

After the repo is setup, you’ll probably want to add other directories eg to import projectb:

svn import projectb file:///home/sonia/svnrepo/trunk/projectb -m "initial import"
mv projectb /tmp

Checkout a working copy:

svn checkout file:///home/sonia/svnrepo/trunk original

Make changes to working copy, then get a list of changes:

svn status --show-updates --verbose foo
svn diff

Finally, save changes back to repository:

svn commit

Or, cancel some changes:

svn revert foo

Repository URLS

file:///
http://
https://
svn://
svn+ssh://

Get Help

svn help foo

Other Common Tasks

  • ignoring files svn propedit svn:ignore targetdir (see”Ignoring Unversioned Items“)
  • to always ignore files of type x (eg .mp3), edit ~/.subversion/config or /etc/subversion/config and set global-ignores under [miscellany] (see Runtime Configuration Area).

1 Comment »

  1. Good summary of svn commands.

    Thanks

    Comment by ocpjp — 17 December 2010 @ 15:34 | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: