Differences between revisions 1 and 12 (spanning 11 versions)
Revision 1 as of 2009-06-16 09:23:24
Size: 6184
Editor: 77-56-110-124
Comment:
Revision 12 as of 2017-11-15 10:07:02
Size: 6497
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).
<<TableOfContents(3)>>

=
= Subversion Overview ==
We are running an Subversion server at '''svn.ee.ethz.ch'''.
Line 6: Line 8:
<<TableOfContents(3)>> == 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 and create Git repositories by yourself.
Line 8: Line 13:

== First steps ==
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.
== Checking Out the Repository ==
Line 14: Line 17:
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.  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.
Line 18: Line 21:
2. 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.  2. 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 21: Line 24:
user@hostname:~>svn checkout svn://svn.ee.ethz.ch/myproj user@hostname:~>svn checkout https://svn.ee.ethz.ch/myproj
Line 31: Line 34:
3. 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.  3. 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 40: Line 43:
4. A more elegant way to achieve the same by creating the structure directly on the Subversion-server:
 
4. A more elegant way to achieve the same by creating the structure directly on the Subversion-server:
Line 46: Line 50:
5. You can start now 'populating' the project directory:  1. You can start now 'populating' the project directory:
Line 49: Line 53:
user@hostname:~>svn checkout svn://svn.ee.ethz.ch/myproj user@hostname:~>svn checkout https://svn.ee.ethz.ch/myproj
Line 56: Line 60:
6. We will now assume that you have got some Perl-files in your home, which you want to add to your trunk. == Adding Files To Your Repository ==

 1
. We will now assume that you have got some Perl-files in your home, which you want to add to your trunk.
Line 78: Line 84:
7. We assume now that you have edited some files and want to commit the changes centrally:  2. We assume now that you have edited some files and want to commit the changes centrally:
Line 95: Line 101:
8. We could now delete the files in the trunk directory and a checkout or update would again fetch the files from the last revision:
== Deleting Files From Your Repository ==

 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:
Line 99: Line 108:
user@hostname:~>svn checkout svn://svn.ee.ethz.ch/myproj/trunk/ user@hostname:~>svn checkout https://svn.ee.ethz.ch/myproj/trunk/
Line 108: Line 117:
10. Before editing files, you should always do a `svn update` to get the latest revision of the files.  2. Before editing files, you should always do a `svn update` to get the latest revision of the files.
Line 119: Line 128:
11. We can now generate a 'tag' (a snapshot of the last revision): == Generating Tags In A Repository ==

 
1. We can now generate a 'tag' (a snapshot of the last revision):
Line 125: Line 136:
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 130: Line 141:
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 135: Line 146:
user@hostname:~>svn ls svn://svn.ee.ethz.ch/myproj/tags/ user@hostname:~>svn ls https://svn.ee.ethz.ch/myproj/tags/
Line 140: Line 151:
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 142: Line 153:
== Further steps ==
== Further Steps ==
Line 145: Line 157:
If you want to change your SVN-password, proceed at[[https://svn.ee.ethz.ch/svnpasswd|Changing your Subversion password]] == Migrating a CVS to a Subversion Repository ==
Line 147: Line 159:
== Migrating a CVS to a Subversion Repository ==
Line 152: Line 163:

== Known Problems ==

[[/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 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:

  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.

user@hostname:~>mkdir myproj

  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.

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.

  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.

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
  1. 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
  1. 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

  1. 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).

  1. 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

  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:

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.
  1. 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

  1. 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/

12. 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

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

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)