Subversion Notes
Subversion is a program similar to "Dropbox": we use it to keep a set of folders and files in sync across
a set of computers. In particular, we will be using it to securely share your code across your group (and with the
instructor and TA). The key differences from Dropbox are:
- Individual files can be designated as being shared. (in Dropbox, the entire Dropbox folder is shared)
- Files are only exchanged when you ask for them to be exchanged. Dropbox will automatically and immediately
move a changed file to the other computers. In contrast, you have to explicitly tell subversion to
share a change that you have made or to download the changes of others.
Documentation
- Windows: Once you have installed subversion, you will have a local copy of the full documentation (see the Subversion folder in Programs).
- Unix (command-line): SVN Book and
SVN Cheatsheet
Getting Started
Subversion trees for each of your groups have been created and
pre-loaded with OUlib and
folders for each of your projects (and a test project). Below are the
instructions for connecting to these trees:
Windows
Unix (Mac or Linux)
- Create a folder on your disk to work in (e.g., call it 'groupwork').
- In a terminal window: "cd" to this folder
- "svn checkout https://cses1@repos.cs.ou.edu/svn/cses1"
with the "1" substituted with your group number.
- You will then be prompted for your group's password.
- You will then be prompted for your group's password.
- The initial checkout will take a few seconds. After this is
complete, you will have a complete copy of your group's
subversion repository. Within your groupwork folder, you will
find several folders, including: lib, include, project1,
project2, etc.
Note that these are only local copies of your group's folder.
You will have to take additional steps to share your changes
and to receive changes from your other group members (see
below).
Using Subversion
Windows
- To receive changes to existing files or any newly added files:
- right click on the groupwork folder
- select SVN Update
- once you enter the password, you will receive copies of
new and changed files
- To select a file to share:
- right click on the file
- select Tortoise SVN and then select add
- Note: your file has not actually been shared (see the next
step)
- To upload new and changed files:
- right click on the file or on the folder
- select Commit
- once you enter the password, the selected files or folders
will be copied to the main server
- When you update or commit, if you receive an error that the file
is already locked, then try the following:
- Move to the lowest level folder in which you see this
error.
- Right click on the folder and select Tortoise SVN / clean
- Try your update or commit again
- If it works, then you are done
- If not, then move up one folder and repeat starting at step #2
Unix
The commands below assume that you already have an open terminal
window and that you have "cd'ed" to the subversion folder of interest.
- To pull the most recently checked in files from the server,
use:
"svn update"
Note that this will only update the current folder and its subfolders
- To add a file/folder to the subversion tree, use:
"svn add foo", where "foo" is the name of the file or the
folder
Note: if you add a folder, all of its contents will be added,
too (which may or may not be desirable).
- To copy changed and committed files to the server, use:
"svn commit"
Note that this will only update the current folder and its subfolders
Note 2: if you see an error that EDITOR is not defined, you have two options:
File/Folder Color Codes in Windows
Once a file/folder is part of a subversion repository, your file
browser will color code the icons. Here are the key colors:
- Green check mark: you have not made changes to the file since
you last downloaded or uploaded the file.
- Red exclamation point: you have made a change to the file
- Blue question mark: the file/folder has not been added to the
repository (see Add above)
Notes for All
fagg@cs.ou.edu
Last modified: Wed Feb 29 20:53:22 2012