September 2009
Beginner
942 pages
85h 34m
English
This section provides a very quick tour of using Subversion for version control. We start with the initial version of a project for importing into Subversion:
$ find /tmp/hello -print Show directory layout
/tmp/hello
/tmp/hello/branches Directory for branch development
/tmp/hello/tags Directory for tagged releases
/tmp/hello/trunk
/tmp/hello/trunk/hello.c Mainline development is done on the trunk
/tmp/hello/trunk/Makefile
/tmp/hello/trunk/READMEThe next steps are to create the repository and then to import the project into it:
$svnadmin create /path/to/svnrepos$svn import /tmp/hello file:///path/to/svnrepos -m "initial import"Adding /tmp/hello/trunk Adding /tmp/hello/trunk/hello.c Adding /tmp/hello/trunk/Makefile Adding /tmp/hello/trunk/README Adding /tmp/hello/branches Adding /tmp/hello/tags Committed revision 1.
Now that the project exists in Subversion, we check out a working copy into a sandbox underneath our home directory and start making changes:
$cdMove to home directory $svn checkout file:///path/to/svnrepos helloCheck out working copy A hello/trunk A hello/trunk/hello.c A hello/trunk/README A hello/trunk/Makefile A hello/branches A hello/tags Checked out revision 1. $cd hello/trunkChange to sandbox $vi message.c hello.c MakefileMake changes 3 files to edit $cat message.cShow newly created file const char message[ ] = "hello, world!"; $makeCompile program and test it cc -c -o hello.o hello.c cc -c -o message.o message.c cc -O hello.o ...