Difference between revisions of "Subversion"

From GeodesyLab
Jump to: navigation, search
(General work cycle)
(Pre-requisites)
 
(8 intermediate revisions by 2 users not shown)
Line 4: Line 4:
  
 
The idea behind our set up is to allow for anonymous public access of specific products (parts) which are simultaneously changed/updated/further developed. So keep in mind that the initial set-up gives the whole world reading access to your project. If you want to share only parts of it, additional steps must be taken. Those are described at the very end of this page.
 
The idea behind our set up is to allow for anonymous public access of specific products (parts) which are simultaneously changed/updated/further developed. So keep in mind that the initial set-up gives the whole world reading access to your project. If you want to share only parts of it, additional steps must be taken. Those are described at the very end of this page.
 +
 +
An in-depth presentation of all subversion is available here: http://svnbook.red-bean.com/
  
 
===Existing Geodesy-Lab projects and anonymous access===
 
===Existing Geodesy-Lab projects and anonymous access===
 +
 +
Existing projects are:<br/>
 +
- [[CrusDe | CrusDe]] <br/>
 +
- [[TSMatlab | TSMatlab]] <br/>
 +
  
 
Anonymous access is read-only. Currently any existing project can be retrieved using:
 
Anonymous access is read-only. Currently any existing project can be retrieved using:
Line 11: Line 18:
 
svn checkout svn://svn.gps.alaska.edu/<PROJECT-NAME>
 
svn checkout svn://svn.gps.alaska.edu/<PROJECT-NAME>
 
</pre>
 
</pre>
 +
 +
To actually submit your changes you must obtain the project via an ssh-tunnel:
 +
<pre>
 +
svn checkout svn+ssh://USERNAME@fairweather.gps.alaska.edu/<PATH-TO-PROJECT>/<PROJECT-NAME>
 +
</pre>
 +
 +
Email Ronni or Jeff to get the path.
  
 
===Pre-requisites===
 
===Pre-requisites===
 
- unix account at geodesy lab<br/>
 
- unix account at geodesy lab<br/>
 
- member of group 'svn'<br/>
 
- member of group 'svn'<br/>
- local installation of a subversion client (comes with most linux dists, check [http://tortoisesvn.tigris.org/ http://tortoisesvn.tigris.org/] for a (graphical) windows client)<br/>
+
- local installation of a subversion client (<code>svn</code> comes with most linux dists, check [http://tortoisesvn.tigris.org/ http://tortoisesvn.tigris.org/] for a (graphical) windows client)<br/>
  
 
===General set-up cycle===
 
===General set-up cycle===
Line 75: Line 89:
 
This is essential; especially if several people work on the same project. At several points you will need your password - sometimes multiple times.
 
This is essential; especially if several people work on the same project. At several points you will need your password - sometimes multiple times.
  
=====Update your working copy====
+
====Update your working copy====
 
<pre>
 
<pre>
 
svn update [file | directory]
 
svn update [file | directory]
<pre>
+
</pre>
  
 
subversion will compare your working copy against parts or the whole project. Outdated files will be updated. If local files have changes that are
 
subversion will compare your working copy against parts or the whole project. Outdated files will be updated. If local files have changes that are
 
not yet committed and an update is necessary, svn tries its best to merge the files. However, conflicts may arise and have to be solved by talking to people and then informing subversion about the result (see 'svn help resolved'). You can update a single file or a subdirectory by either giving the respective parameter or 'cd' into that directory.
 
not yet committed and an update is necessary, svn tries its best to merge the files. However, conflicts may arise and have to be solved by talking to people and then informing subversion about the result (see 'svn help resolved'). You can update a single file or a subdirectory by either giving the respective parameter or 'cd' into that directory.
  
=====Change your working copy====
+
====Change your working copy====
 
Use your editor /program to change the textfiles /binary products. subversion will know about what has changes (magically :) ). However, if you do stuctural changes to the project (adding of files, renaming, moving, copying, new directories, etc.) subversion must know about that. Instead of using the common unix commands for doing so, use:
 
Use your editor /program to change the textfiles /binary products. subversion will know about what has changes (magically :) ). However, if you do stuctural changes to the project (adding of files, renaming, moving, copying, new directories, etc.) subversion must know about that. Instead of using the common unix commands for doing so, use:
  
Line 89: Line 103:
 
svn add [file | directory]
 
svn add [file | directory]
 
svn [copy | move | delete | mkdir ...]
 
svn [copy | move | delete | mkdir ...]
<pre>
+
</pre>
  
 
If you need help on the syntax of a specific command or a full list of commands:
 
If you need help on the syntax of a specific command or a full list of commands:
 
<pre>
 
<pre>
 
svn help
 
svn help
<pre>
+
</pre>
  
 
helps.
 
helps.
  
=====Commit your changes====
+
====Commit your changes====
 
Whatever you did is only locally known.  
 
Whatever you did is only locally known.  
  
 
<pre>
 
<pre>
 
svn commit [file | directory]
 
svn commit [file | directory]
<pre>
+
</pre>
  
 
Works in the same way as <code>svn update</code>, only in the other direction. Hence, the repository will be updated with your changes. You will get the opportunity to comment on the changes you made. Make good use of that - it will help in the future! Subversion will increase the revision number and add your comments to the history.
 
Works in the same way as <code>svn update</code>, only in the other direction. Hence, the repository will be updated with your changes. You will get the opportunity to comment on the changes you made. Make good use of that - it will help in the future! Subversion will increase the revision number and add your comments to the history.
  
 
===Share only parts of your work===
 
===Share only parts of your work===
http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.serverconfig.svnserve</pre>
+
http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.serverconfig.svnserve

Latest revision as of 04:06, 14 January 2009

What's that all about?

The idea is very old and popular in software development: have somebody keep track of changes you make to a product and hence remain able to go back in history...

The idea behind our set up is to allow for anonymous public access of specific products (parts) which are simultaneously changed/updated/further developed. So keep in mind that the initial set-up gives the whole world reading access to your project. If you want to share only parts of it, additional steps must be taken. Those are described at the very end of this page.

An in-depth presentation of all subversion is available here: http://svnbook.red-bean.com/

Existing Geodesy-Lab projects and anonymous access

Existing projects are:
- CrusDe
- TSMatlab


Anonymous access is read-only. Currently any existing project can be retrieved using:

svn checkout svn://svn.gps.alaska.edu/<PROJECT-NAME>

To actually submit your changes you must obtain the project via an ssh-tunnel:

svn checkout svn+ssh://USERNAME@fairweather.gps.alaska.edu/<PATH-TO-PROJECT>/<PROJECT-NAME>

Email Ronni or Jeff to get the path.

Pre-requisites

- unix account at geodesy lab
- member of group 'svn'
- local installation of a subversion client (svn comes with most linux dists, check http://tortoisesvn.tigris.org/ for a (graphical) windows client)

General set-up cycle

Setting up a new project-root

- login to fairweather
- cd to $SVNREPO
- execute 'svnadmin create <PROJECT-NAME>'
- exit

Repository layout & initial data import

The repository layout is totally up to you. If you want to make versions available only based on version number, that's fine. However, for a more sophisticated use, the subversion team recommends the following layout:

$SVNREPO
   <PROJECT-NAME>/
      trunk/
      tags/
      branches/
   <my project>/
      trunk/
      tags/
      branches/
   ...

The trunk directory will hold the initial project data. tags and branches are explained below.

- 'mkdir tmpdir'
- optional: 'mkdir tmpdir/trunk' etc.
- copy (not move!) your project files / directories etc. into tmpdir/trunk
- 'cd tmpdir'
- 'svn import . svn+ssh://username@svn.gps.alaska.edu/<PROJECT-NAME> -m "initial import" '

You will be asked for your password. The long list of characters that pops up on the screen should end with something like:

Committed revision 1.

- 'cd ..'
- 'rm -rf tmpdir'

Your project is now accessible by the world! yeah.

Initial checkout

To have subversion keep track on the changes you do to your project you will have to work on a working copy of your project from the repository:

- cd to a place where you would want to have that working copy - 'svn checkout svn+ssh://username@svn.gps.alaska.edu/<PROJECT-NAME>/trunk <PROJECT-NAME>'

I assume you created the recommended directory structure. As I said the whole branches and trunk story will be covered later. Anyway, that's it. You got your own copy and the world can follow your changes. yeah.

General work cycle

The general work cycle is the following:

update-change-commit

This is essential; especially if several people work on the same project. At several points you will need your password - sometimes multiple times.

Update your working copy

svn update [file | directory]

subversion will compare your working copy against parts or the whole project. Outdated files will be updated. If local files have changes that are not yet committed and an update is necessary, svn tries its best to merge the files. However, conflicts may arise and have to be solved by talking to people and then informing subversion about the result (see 'svn help resolved'). You can update a single file or a subdirectory by either giving the respective parameter or 'cd' into that directory.

Change your working copy

Use your editor /program to change the textfiles /binary products. subversion will know about what has changes (magically :) ). However, if you do stuctural changes to the project (adding of files, renaming, moving, copying, new directories, etc.) subversion must know about that. Instead of using the common unix commands for doing so, use:

svn add [file | directory]
svn [copy | move | delete | mkdir ...]

If you need help on the syntax of a specific command or a full list of commands:

svn help

helps.

Commit your changes

Whatever you did is only locally known.

svn commit [file | directory]

Works in the same way as svn update, only in the other direction. Hence, the repository will be updated with your changes. You will get the opportunity to comment on the changes you made. Make good use of that - it will help in the future! Subversion will increase the revision number and add your comments to the history.

Share only parts of your work

http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.serverconfig.svnserve