Differences between revisions 2 and 15 (spanning 13 versions)
Revision 2 as of 2010-12-20 11:11:47
Size: 6434
Editor: cresnik
Comment:
Revision 15 as of 2020-09-03 12:58:43
Size: 6308
Editor: pmeier
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Subversion =
We are running an Subversion server at '''svn.ee.ethz.ch''' (svnserve daemon).
#rev 2018-09-25 pmeier
#rev 2020-09-03 pmeier
<<TableOfContents(3)>>

=
= Subversion Overview ==
We are running an Subversion server at '''svn.ee.ethz.ch'''.
Line 6: Line 10:
<<TableOfContents(3)>>

Line 10: Line 11:
If you haven't got a project to work on yet, you will need a repository for it. Send us a request with the name of the repository you wish to have, a responsible person for it and a list of users who need to have full access to it, to support@ee.ethz.ch . We will create it for you on the server and send you the passwords. --(Please send a request to support@ee.ethz.ch with the name of the repository you wish to have. We will create the repository and send you the access credentials. You can then add coworkers by your own through http://svnmgr.ee.ethz.ch/.)--
 
We don't actually create new SVN repositories anymore. Please use Git on https://git.ee.ethz.ch. instead. As a D-ITET user you can log in there with your NETHZ credentials and create Git repositories by yourself.
Line 15: Line 18:

 1. Create a subdirectory in your home directory, preferably with the same name as the repository, which would correspond to the name of one of your projects.
<<BR>><<BR>>
Create a subdirectory in your home directory, preferably with the same name as the repository, which would correspond to the name of one of your projects.
Line 20: Line 23:
 1. Make first contact with the svn server, you will be asked to enter your password, which will be saved in a hidden `.svn` folder so you won't be asked anymore. Make first contact with the svn server, you will be asked to enter your password, which will be saved in a hidden `.svn` folder so you won't be asked anymore.
Line 23: Line 26:
user@hostname:~>svn checkout svn://svn.ee.ethz.ch/myproj user@hostname:~>svn checkout https://svn.ee.ethz.ch/myproj
Line 33: Line 36:
 1. Now you can create a structure inside this project. We recommend one like "trunk", "releases" and "tags". The first is for the main development (working directory), the second is for milestones of your development (fixed releases without known bugs) and in tags you can put in fixed steps in your development toward a new release. This is just a recommendation though. Now you can create a structure inside this project. We recommend one like "trunk", "releases" and "tags". The first is for the main development (working directory), the second is for milestones of your development (fixed releases without known bugs) and in tags you can put in fixed steps in your development toward a new release. This is just a recommendation though.
Line 43: Line 46:
 1. A more elegant way to achieve the same by creating the structure directly on the Subversion-server: A more elegant way to achieve the same by creating the structure directly on the Subversion-server:
Line 49: Line 52:
 1. You can start now 'populating' the project directory: You can start now 'populating' the project directory:
Line 52: Line 55:
user@hostname:~>svn checkout svn://svn.ee.ethz.ch/myproj user@hostname:~>svn checkout https://svn.ee.ethz.ch/myproj
Line 61: Line 64:
 1. We will now assume that you have got some Perl-files in your home, which you want to add to your trunk. We will now assume that you have got some Perl-files in your home, which you want to add to your trunk.
Line 83: Line 86:
 1. We assume now that you have edited some files and want to commit the changes centrally: We assume now that you have edited some files and want to commit the changes centrally:
Line 103: Line 106:
 1. We could now delete the files in the trunk directory and a checkout or update would again fetch the files from the last revision: We could now delete the files in the trunk directory and a checkout or update would again fetch the files from the last revision:
Line 107: Line 110:
user@hostname:~>svn checkout svn://svn.ee.ethz.ch/myproj/trunk/ user@hostname:~>svn checkout https://svn.ee.ethz.ch/myproj/trunk/
Line 116: Line 119:
 1. Before editing files, you should always do a `svn update` to get the latest revision of the files. Before editing files, you should always do a `svn update` to get the latest revision of the files.
Line 129: Line 132:
 1. We can now generate a 'tag' (a snapshot of the last revision): We can now generate a 'tag' (a snapshot of the last revision):
Line 135: Line 138:
user@hostname:~>svn copy -m "tagging version release-1.0" svn://svn.ee.ethz.ch/myproj/trunk \ svn://svn.ee.ethz.ch/myproj/tags/release-1.0; user@hostname:~>svn copy -m "tagging version release-1.0" https://svn.ee.ethz.ch/myproj/trunk \ https://svn.ee.ethz.ch/myproj/tags/release-1.0;
Line 140: Line 143:
user@hostname:~>svn rm svn://svn.ee.ethz.ch/myproj/tags/badlytaggedversion user@hostname:~>svn rm https://svn.ee.ethz.ch/myproj/tags/badlytaggedversion
Line 145: Line 148:
user@hostname:~>svn ls svn://svn.ee.ethz.ch/myproj/tags/ user@hostname:~>svn ls https://svn.ee.ethz.ch/myproj/tags/
Line 147: Line 150:
12. To move whole branches from one place in the repository to another: To move whole branches from one place in the repository to another:
Line 150: Line 153:
user@hostname:~>svn mv svn://svn.ee.ethz.ch/myproj/trunk/test/subdir svn://svn.ee.ethz.ch/myproj/trunk/plan/ user@hostname:~>svn mv https://svn.ee.ethz.ch/myproj/trunk/test/subdir https://svn.ee.ethz.ch/myproj/trunk/plan/
Line 156: Line 159:
== Changing Your SVN Repository Password ==
Line 158: Line 160:
If you want to change your SVN-password, proceed at[[https://svn.ee.ethz.ch/svnpasswd|Changing your Subversion password]] == Known Problems ==
Line 160: Line 162:
== Migrating a CVS to a Subversion Repository ==

After logging in on a Solaris-machine, execute the following command:
{{{
usr/pack/subversion-1.2.1-rp/cvs2svn/cvs2svn --create -s $URL_OF_NEW_SVN_REPO $URL_OF_OLD_CVS_REPO
}}}
[[/GnomeKeyRing|GNOME keyring]] is locked and we are non-interactive
----
[[CategoryREVC]]

Subversion Overview

We are running an Subversion server at svn.ee.ethz.ch.

To use Subversion you will need most of the time the svn command which is installed on all of our UNIX platforms. On Windows we suggest using TortoiseSVN, also available in our Windows Environment.

Requesting a Subversion Repository

Please send a request to support@ee.ethz.ch with the name of the repository you wish to have. We will create the repository and send you the access credentials. You can then add coworkers by your own through http://svnmgr.ee.ethz.ch/.)--

We don't actually create new SVN repositories anymore. Please use Git on https://git.ee.ethz.ch. instead. As a D-ITET user you can log in there with your NETHZ credentials and create Git repositories by yourself.

Checking Out the Repository

When you have got a repository you can begin with these steps to start with your project:

Create a subdirectory in your home directory, preferably with the same name as the repository, which would correspond to the name of one of your projects.

user@hostname:~>mkdir myproj

Make first contact with the svn server, you will be asked to enter your password, which will be saved in a hidden .svn folder so you won't be asked anymore.

user@hostname:~>svn checkout https://svn.ee.ethz.ch/myproj
Authentication realm:  myproj
Password for 'muster':
Checked out revision 0.
user@hostname:~>ls -lA myproj
total 8
drwxr-xr-x   7 muster  myproj        512 May 27 18:11 .svn/

There is the .svn folder in which Subversion stores settings like the project repository, server and so on.

Now you can create a structure inside this project. We recommend one like "trunk", "releases" and "tags". The first is for the main development (working directory), the second is for milestones of your development (fixed releases without known bugs) and in tags you can put in fixed steps in your development toward a new release. This is just a recommendation though.

An example of this (not the best way, but just to show how it would work):

cd myproj
mkdir trunk tags releases
svn add trunk tags releases

A more elegant way to achieve the same by creating the structure directly on the Subversion-server:

user@hostname:~>cd myproj
user@hostname:~>svn mkdir trunk tags releases

You can start now 'populating' the project directory:

user@hostname:~>svn checkout https://svn.ee.ethz.ch/myproj
A  myproj/trunk
A  myproj/revisions
A  myproj/tags

Note that here you do not create the subdirectories yourself, Subversion does it for you as defined on the server and the system adds necessary information in the .svn subdirectory too.

Adding Files To Your Repository

We will now assume that you have got some Perl-files in your home, which you want to add to your trunk.

user@hostname:~>cp ~/perl/*.pl trunk

To let Subversion know that there are new files which need to be stored centrally, do the following:

user@hostname:~>cd trunk
user@hostname:~>svn add *
A         admin_portal.pl
A         adv_reg_portal.pl
A         assign_to_reviewer.pl
A         assign_to_tc.pl
A         attendees.pl
A         build_sessions.pl
A         change_cont_pass.pl
A         change_rev_pass.pl
A         change_tc_pass.pl
...

The 'A' stands for added (to Subversion).

We assume now that you have edited some files and want to commit the changes centrally:

user@hostname:~>svn commit -m "Saving the first version" #-m is the comment for this revision
Adding         trunk
Adding         trunk/admin_portal.pl
Adding         trunk/adv_reg_portal.pl
Adding         trunk/assign_to_reviewer.pl
Adding         trunk/assign_to_tc.pl
Adding         trunk/attendees.pl
Adding         trunk/build_sessions.pl
Adding         trunk/change_cont_pass.pl
Adding         trunk/change_rev_pass.pl
Adding         trunk/change_tc_pass.pl
Transmitting file data ..............................................
Committed revision 1.

Deleting Files From Your Repository

We could now delete the files in the trunk directory and a checkout or update would again fetch the files from the last revision:

user@hostname:~>rm -r trunk
user@hostname:~>svn checkout https://svn.ee.ethz.ch/myproj/trunk/
A  trunk/logadmin.pl
A  trunk/submit_paper.pl
A  trunk/enroll.pl
A  trunk/include
A  trunk/include/header_one.inc
...
Checked out revision 4.

Before editing files, you should always do a svn update to get the latest revision of the files.

user@hostname:~>vim trunk/admin_portal.pl
user@hostname:~>svn commit -m "saving admin_portal.pl" trunk
Sending        trunk/admin_portal.pl
Transmitting file data ...
Committed revision 5.

Note: Revision 5 is a set for the repository tree (for ALL the files) even if the only difference between revision 4 and 5 is in the file admin_portal.pl.

Generating Tags In A Repository

We can now generate a 'tag' (a snapshot of the last revision):

#as a first important step, check-in all changed files of the trunk
user@hostname:~>svn commit -m "pretagging commit" trunk
#then do the tagging directly on the server
user@hostname:~>svn copy -m "tagging version release-1.0" https://svn.ee.ethz.ch/myproj/trunk \ https://svn.ee.ethz.ch/myproj/tags/release-1.0;

To remove a badly tagged version you can do this too directly server:

user@hostname:~>svn rm https://svn.ee.ethz.ch/myproj/tags/badlytaggedversion

To have a look which taged versions are available:

user@hostname:~>svn ls https://svn.ee.ethz.ch/myproj/tags/

To move whole branches from one place in the repository to another:

user@hostname:~>svn mv https://svn.ee.ethz.ch/myproj/trunk/test/subdir https://svn.ee.ethz.ch/myproj/trunk/plan/

Further Steps

This above were just basic steps to show you the concept behind Subversion. We recommend you to read the reference book called Version control with Subversion

Known Problems

GNOME keyring is locked and we are non-interactive


CategoryREVC

Services/VersionControlSystems/Subversion (last edited 2020-09-03 12:58:43 by pmeier)