User Tools

Site Tools


documentation:lab46svn


Corning Community College

Subversion on Lab46

~~TOC~~

Setting up your Subversion Repository

A good place to stop before beginning this task would be to check out the first 2 chapters of the free "Version Control With Subversion" by Ben Collins-Sussman, Brian W. Fitzpatrick & C. Michael Pilato (an O'Reilly book that is well worth familiarizing yourself with).

Subversion, and other version control systems, allow you to version (or snapshot) instances of files, much as one would manually file dated versions of documents, that can be referenced, retrieved, and compared with other versions. Version control is particularly important in program development as many thousands of changes take place in any code base.

It is prudent to have a capability to “step back in time” should some modifications prove unsuccessful, to avoid needless data re-entry and effectively move forward.

What we are going to do now is initialize your personal Lab46 Subversion repository- a resource that each user on Lab46 receives, and can be used for an array of purposes, far beyond the requirements of any class activities you may encounter. Familiarize yourself with this important development tool, so that you can effectively use it into the future.

Step 0: Create some files for our repository

For the purposes of this tutorial, we'll create a special directory in which to store our source files. We'll call this directory cprog, and we'll want create it underneath our ~/src/ subdirectory.

At the Lab46 prompt, do the following:

lab46:~$ mkdir -p src/cprog
lab46:~$ 

Step 1a: Setting up your repository (local on Lab46)

To accomplish this, do the following at the Lab46 prompt (substitute your username in place of the literal string “<username>” in the example below):

lab46:~$ svn import src http://www/svn/<username>/src -m "Initial import"
Adding      src/cprog
Adding      src/submit
Adding      src/Makefile

Committed revision 1.
lab46:~$ 

To avoid some problems, you can move your existing src directory out of the way:

lab46:~$ mv src src.bak
lab46:~$ 

Next, we'll check out our repository:

lab46:~$ svn co http://www/svn/<username>/src src
A    src/cprog
A    src/submit
A    src/Makefile
Checked out revision 1.
lab46:~$ 

Step 1b: Setting up your repository (remotely)

To accomplish this, do the following at the Lab46 prompt (substitute your username in place of the literal string “<username>” in the example below):

lab46:~$ svn import src http://lab46.corning-cc.edu/svn/<username>/src -m "Initial import"
Adding      src/cprog
Adding      src/submit
Adding      src/Makefile

Committed revision 1.
lab46:~$ 

To avoid some problems, you can move your existing src directory out of the way:

lab46:~$ mv src src.bak
lab46:~$ 

Next, we'll check out our repository:

lab46:~$ svn co http://lab46.corning-cc.edu/svn/<username>/src src
A    src/cprog
A    src/submit
A    src/Makefile
Checked out revision 1.
lab46:~$ 
documentation/lab46svn.txt · Last modified: 2013/02/01 09:16 by wedge