Using svn for this class

DJ has created the following svn repository for us:
https://repo.bowdoin.edu/svn/ltoma/cs3250spr2017/(account-name)
where (account-name) is one of:
abhalla		clmccart	dparsons	gmmallet	jrward		mbehar		rstpierr
bgreenbe	dgans		esunshin	itumanen	jwebber		ongimor
sngo bwent	dhines		ewurma	jnawrock	lbleckel	pwang2		svaldivi
For example,
https://repo.bowdoin.edu/svn/ltoma/cs3250spr2017/abhalla
To start, go to your desired machine (for example, your laptop) and create a folder for this class. I like to name it CompGeom-svn in order to show that the folder is backed up by svn.
[ltoma@lobster ~]$mkdir CompGeom-svn
[ltoma@lobster ~]$cd CompGeom-svn

Now you need to link this folder with your svn folder:

svn co https://repo.bowdoin.edu/svn/ltoma/cs3250spr2017/(account-name)
(replace account-name by your userid as above)
For example:
[ltoma@lobster ~/CompGeom-svn]$svn co  https://repo.bowdoin.edu/svn/ltoma/cs3250spr2017/abhalla
Checked out revision 2639.
[ltoma@lobster ~/CompGeom-svn]$ls
abhalla
[ltoma@lobster ~/CompGeom-svn]$
This will create a clone abhalla in the current directory. This is a clone or copy of the abhalla folder on the server. First time the folder will be empty (cause you didn't put anything in it yet).
[ltoma@lobster ~/CompGeom-svn]$cd abhalla
[ltoma@lobster ~/CompGeom-svn/abhalla]$ls
[ltoma@lobster ~/CompGeom-svn/abhalla]$
Create a folder inside your folder for each assignment. For example, assuming your first assignment is to write a program that prints I love this class, you would start by creating a folder for it:
[ltoma@lobster ~/abhalla]$mkdir Love
[ltoma@lobster ~/abhalla]$ls
Love 
[ltoma@lobster ~/abhalla]$cd Love 
[ltoma@lobster ~/abhalla/Love]$
Now you should start creating and editing files in this folder. Open Emacs, create and save a file, name it for example love.c.
[ltoma@lobster ~/abhalla/Love]$ls
love.c
[ltoma@lobster ~/abhalla/Love]$
Or, if you already have some files somewhere else, copy them in the Love directory like so (you need to change it so that you copy from wherever the most recent version of your code is).
[ltoma@lobster ~/abhalla/Love]$cp ~/Desktop/randomcode.c .
[ltoma@lobster ~/abhalla/Love]mv randomcode.c love.c
[ltoma@lobster ~/abhalla/Love]ls
love.c
[ltoma@lobster ~/abhalla/Love]

Now you got a file love.c in your folder. But the svn server does not know anything about this file until you add them. Doing an svn stat will tell you teh differences between your local clone and the server.

[ltoma@lobster ~/abhalla/Love]$svn stat
?       Love
This says that folder Love is not aded to svn. You have to add it:
svn add  Love 
Then you need to commit:
svn ci -m "my first love"
You will have to add new files as you create them. The svn should only contain header, source and make files, and not objects and executables.

From this point on, your basic routine will be: update, edit, commit.

The main thing to understand is that the code is saved on the server, and what you have on your computer is a local copy of the code on the server. You can have as many local copies as you want on as many computers as you want, and the other people in your team can have their own local copies. Each one of you will modify their own local copy, and they need to send their changes to the server; this is done via the command svn ci (svn terminology, stands for checkin; also called push in git terminology). To grab the most recent version from the server, you need to co (svn terminology, stands for checkout, or pull in git terminology).

Hope this gives you sufficient details to get started with svn. Post on piazza if you encounter any problems! In time you will see that svn is incredibly helpful and you will become addicted (I keep all my files on svn).


Last modified: Fri Jan 27 14:49:04 EST 2017