Resources‎ > ‎Programming‎ > ‎C++‎ > ‎C++ Tutorial‎ > ‎Lesson 1‎ > ‎


Create the main git repository database on a server

Create the repository

  • log into SIT's ssh server.
  • Create a directory to store your subversion repositories
$> mkdir ~/svnrepo
  • create a repository
$> cd ~/svnrepo
$> svnadmin create --fs-type fsfs INFO3220.svn

For GUI users...

Checkout the project from your repository 

  • on your computer (your notebook, desktop PC or PC in the SIT lab....not the SIT's server)
$> svn co svn+ssh://[username][home directory]/gitrepo/INFO3220.svn

NOTE: your home directory is ~.  To find out the absolute path of your home directory, run
$> cd~ ; pwd
pwd shows the absolute path to the current directory.  For instance, if pwd shows /usr/cs1/abcd6112, then your git repository for, say, INFO3220.git will be

Checkout the project from your repository with Windows using TortoiseSVN tool:

  • Open up My Documents folder.
  • Right-click on the folder and select SVN Checkout.
  • URL of repository:
svn+ssh://[username][home directory]/gitrepo/INFO3220.svn
  • Checkout directory: [path to My Documents]\INFO3220.svn
  • Click OK.
  • Whatever you do with your code will be in this new INFO3220.svn directory.

Using SVN:


  • Typically, the best practice on using SVN is to create 3 directories called "trunk", "branches" and "tags". Trunk is for current codes. If the codes are differing in direction, like trying an experimental code, then it's kept in branches. And If the codes are matured and prepared for release, they are kept in tags.
  • For the sake of simplicity, we will ignore the trunk/branches/tags structure. Instead, we will just store our projects directly in the repository.
  • For every files and directories created in mysvnrepo directory, we will have to explicitly specify we're going to add them into repository via SVN ADD. To do this, in Windows, select the files and directories to be added, right-click -> TortoiseSVN -> Add. Click OK.

  • This adding step will not synchronize your files to the server yet. To commence the synchronization process, you will need to do a SVN COMMIT. Right-click on mysvnrepo -> SVN Commit. You might want to fill in the Message to keep a log of what changes you have made to the codes. Then select OK.

  • When you want to update to the latest copy of your code, use SVN UPDATE. To do this, right-click mysvnrepo -> SVN Update.

NOTE: In a group work situation, your code might conflict with your group members. In that case, use SVN MERGE. See

SVN Summary: In order to use SVN, you will need to understand the concept it operates on. The main vocabularies are:

  • SVNADMIN CREATE: create svn database.
  • SVN CHECKOUT (co): checkout svn database to a private working directory.
  • SVN ADD: to add files and directories you want into the repository.
  • SVN COMMIT: to commit all the adding you done on SVN ADD and also all the modification to the already SVN ADDED files previously. This will upload all new files and changes to the server.
  • SVN UPDATE: to update your working copy to the latest code.
  • SVN MERGE: if your work conflicts with your group member's work, then you will need to check the differences and resolve them manually using a text editor.