-

hey viewer, we're moving!

We are currently transitioning to a new web system, so we are not updating this wikisite anymore.

The public part of the new web system is available at http://www.ira.disco.unimib.it


Accessing the IRA SVN

From Irawiki

Jump to: navigation, search

Here follows the procedure you should use in order to access the IRA VCS service.

Contents

Request an account (mandatory)

First of all you need an account on the vcs server computer.

Ask prof. Sorrenti Domenico Giorgio, Furlan Axel or Ballardini Augusto Luis to create your new account.

Request authorisation for a specific project (mandatory, svn only)

Now that you can access the server, you need to be authorised for a specific project.

Ask prof. Sorrenti Domenico Giorgio, Furlan Axel or Ballardini Augusto Luis to authorize you (specify the project name).

Repository access

SVN repository

Here a simple example on how to interact with the repository. The example shows a checkout command, that you need to start working with the repository.

svn checkout svn+ssh://user@irasvn.disco.unimib.it/svn/project_name

Simple explanation:

  • checkout is the command to checkout a repository :-) you can use the short form co
  • svn+ssh is the protocol used: svn protocol is not protected so we are tunneling it with ssh. After any command, in fact, it will prompt for your login password (look at the subsection below for some hints)
  • user@server is the standard ssh way to specify user and host

GIT repository

git clone user@irasvn.disco.unimib.it:/git/project_name.git

Creating a new repository

Follow the instructions in the README file in the /git folder

Setup ssh key not to insert the password every time

SSH has a very nice feature so that you can login without specifying every time the password. This is still safe since you use a public/private key mechanism to authenticate.

The setup is very simple and it will save you a lot of time/pain

  1. Generate a new ssh key
    ssh-keygen -t dsa
    where -t means the type.. dsa is the one used with ssh2.. if you prefer you can use the ssh1 rsa type
    1. it will prompt for the location: specify /home/user/.ssh/keyname
      1. of course change user with your actual username
      2. note that ~/.ssh will not work
      3. choose a meaningful keyname such as ira_svn_key
    2. it will prompt for a password.. choose a good password..
    3. insert password again..
    4. now you have in your ~/.ssh folder two new files: keyname and keyname.pub
  2. copy keyname.pub to ~/.ssh/authorized_keys2 on svn computer
     scp ~/.ssh/keyname user@irasvn.disco.unimib.it/home/user/.ssh/authorized_keys2
    1. a new file authorized_keys2 will be created in the remote .ssh folder
    2. note that if you already have a authorized_keys2 file you need to add the keyname.pub content into it
  3. edit/create the file ~/.ssh/config in your local computer adding this lines
Host irasvn.disco.unimib.it
	User username_to_use_on_remote_computer_usually_your_surname
	IdentityFile ~/.ssh/keyname
that's it.. now you can login simply writing
 ssh irasvn.disco.unimib.it
and no user no password will be prompted!!!!

the checkout command seen before will be

 svn co svn+ssh://irasvn.disco.unimib.it/svn/project_name
and every other command will no prompt the password (but you will be authenticated thanks to the key!)

SVN Alternatives

Although our choice of version control system has fallen on subversion we are now thinking to change to a distributed version control system like git or mercurial. Here some motivations IRA Version Control System

Since we started usign git on some projects here some useful links for repo creation

Tips and tricks to use SVN properly and easily

Meaning of most relevant SVN keywords

  • import
  • checkout
  • update
  • commit

Password registration on you computer (optional)

Follow the instructions on how to log-in via SSH without inserting password manually.

Structure of a standard SVN Project

How to structure your repository

Exclude certain folders from repository

In order to exclude one or more folders (e.g. ../bin, ../tmp, ../cache_dir, ecc.) use the following code:

svn propset svn:ignore '*' cache_dir/

Recursively delete subdirectories (like .svn)

find . -type d -name .svn -print0 | xargs -0 rm -rf

Personal tools