Notes on Using Subversion on ICT

With SVN, you edit files locally on your computer (called the "working copy") and 
then upload or "commit" the files to the server "repository". You can download files 
from the server repository by "updating" your working copy. In brief, all your files 
(including past versions) are stored on the IT server and accessible from any 
computer. SVN offers the following features:

- Version Control. When you commit a file to the repository SVN records the changes 
between versions. As a result, all past versions of a file can be accessed.

- Online File Storage. All your files are stored on an Internet-accessible server 
(with a web-interface) meaning you can access your files from anywhere in the world.

- File Sharing. For the "projects" repository all students in your group can access 
the files. No need to email files to your friends.

- Backup. As all versions of files are stored on the server, if you delete a file on 
your laptop you can recover that file from the server.



Guidelines for "projects" Subversion repository
===============================================

The "projects" repository is for storage of files created by students as part of 
project work (e.g. Senior project, assignments for courses). In addition you have 
your own repository named after your username (e.g. "u5000000000") that you can use 
for individual work. Some guidelines on what to include (and what not to) in a 
respository are below.

The "projects" repository is readable and writable by all students (and faculty) 
that have an account on the IT server. This encourages sharing of code and documents 
(and knowledge) between students. If you want your files to be private, don't upload 
to the "projects" repository (instead use your own repository, e.g. "u5000000000").

Respect other peoples work. Even though you can delete files from other projects, 
doesn't mean you are allowed to. Malicious activities against other students will be 
treated as inappropriate use of SIIT computer resources (and punished accordingly). 
Remember, with SVN, the username of all edits is recorded.


What Files (Not) to Include in Your Repository
==============================================

Use the SVN repositories to store the files that you create. Examples include:
- reports (.txt, .doc, .odt, .tex, ...)
- presentations (.ppt, .odp, .key, ...)
- source code (.c, .java, .cpp, .h, .php, ...)
- web sites (.html, .php, .js, ...)

Avoid storing files that are automatically generated (e.g. from compiling source 
code). DO NOT use the repositories to store files you download from other sources:
- object and executable code (.o, .exe, .jar, .dll, .bin, ...)
- generated documents (.pdf, .dvi, LaTeX generated files, ...)
- downloaded documents that others created
- downloaded archives of files (.zip, .tgz, .tar, .rar, ...)
- downloaded media (.avi, .mp3, .mp4, .jpg, ...)

Hint: you can configure SVN to ignore files with a particular extension, e.g. so all 
the .java files are added but .exe files are never added. See 
http://svnbook.red-bean.com/en/1.7/svn.advanced.props.special.ignore.html

DO NOT store material that you do not have permission to use (e.g. copyrighted content). 

On some occasions it MAY be appropriate to store other peoples files in SVN. For 
example, you have a website that uses some publicly available JavaScript or PHP 
libraries. The necessary .js and .php files can be included. Or you use a Java or C 
library in your program: the necessary .c or .java files can be included.

On some occasions it MAY be appropriate to store generated files. For example, you 
generate a PDF from a .doc file. The .doc file should be in the repository. Normally 
the .pdf is not needed in the repository. But if you have a version that you want to 
make available to others, e.g. the final version for your advisor, then it is ok to 
store it in your repository.

You may store media that you created (images, audio, video). However note that 
although there is no hard quota, excessive use of the storage space is discouraged. 
For example, you should not store your 1GB video in the repository.
 
If you are creating a website with a CMS, e.g. Joomla or Drupal, avoid storing the 
entire CMS in the repository. If you are modifying the CMS, then try to arrange it 
so that only the files you edit/create are stored in the repository. Alternatively, 
use your IT server web page (e.g. http://ict.siit.tu.ac.th/~u5000000000/) for your 
website - don't use SVN.


Who Can Access Your Repository
==============================

By default, each user on ict.siit.tu.ac.th has their own private repository, e.g.
https://ict.siit.tu.ac.th/svn/u5000000000/

Only that user can read and write to their private repository. No other student user 
can read or write to another students private repository. You may use this private 
repository for coursework our your own SIIT-related activities.

For the "projects" repository, all users on ict.siit.tu.ac.th has read and write 
access. That is, any student can view files, create files, edit files and delete 
files in the repository:
https://ict.siit.tu.ac.th/svn/projects/

Of course, just because you can edit other students files, doesn't mean you should. 
Remember as part of SVNs version control, the names of every user that 
creates/edits/deletes a file is recorded, and all past versions are available. If 
someone accidentially deletes your file, you can revert to the previous file, 
recovering the delete file.

The username and password for each user is the same as for the login to the IT 
server. To change your password you must change your login password, i.e. SSH into 
ict.siit.tu.ac.th and type 'passwd'.


How To Use Your SVN Repository
==============================

Assume you 

On the command line:

Checkout a repository: 
svn co URL

e.g. if you are a senior project group sg1:
$ svn co https://ict.siit.tu.ac.th/svn/projects/2013/senior/sg1/

Now change into the newly created directory "sg1":
$ cd sg1

Add files to a working copy: 
svn add FILE

e.g. to add all files current directory:
$ svn add *

or to add a specific file only:
$ svn add myfile.txt

Commit files from working copy to repository: 
svn ci

Optionally, include a message, e.g.:
$ svn ci -m "Final release" 

Update working copy with latest files from repository: 
svn update FILE

More examples, including for Windows, are at: http://ict.siit.tu.ac.th/subversion

The SVN Book is free: http://svnbook.red-bean.com/

Go back to the index page.