Personal tools

Difference between revisions of "Svn"

From MohidWiki

Jump to: navigation, search
 
(20 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
==The Mohid subversion repositories==
 
==The Mohid subversion repositories==
 
===Intranet repositories addresses===
 
===Intranet repositories addresses===
Central repository: https://davinci.maretec.ist.utl.pt:8443/svn/
+
 
: Mohid_v4 project https://davinci.maretec.ist.utl.pt:8443/svn/mohid_v4/trunk/
+
The intranet repository is deprecated and should not be used anymore...
: Mohid_net project https://davinci.maretec.ist.utl.pt:8443/svn/mohid_net/trunk/
+
See instead [[codeplex]].
  
 
===Internet (read-only) repositories addresses===
 
===Internet (read-only) repositories addresses===
'''Coming soon'''
+
The official repository is at the [[Codeplex]].
  
 
==GUI clients==
 
==GUI clients==
Simply install presto the tortoise svn [http://tortoisesvn.tigris.org/ Tortoise svn].
+
To quickly download the code please install a gui client. Choose your flavour:
  
===Creating a new local repo===
+
*[[RapidSvn]], very similar environment to source-safe, for windows, linux and mac.
Here's the quick how-to add a new '''mohid_net''' project from our local intranet repository:
+
*[[TortoiseSvn]], elegantly inserts itself into your windows explorer environment (windows only).
*Create a new folder:
 
<htm><a href="http://content.screencast.com/users/GRiflet/folders/Jing/media/7f6fa34c-88ed-4442-9da3-fefde4ebc45f/2008-12-12_2345.png"><img src="http://content.screencast.com/users/GRiflet/folders/Jing/media/7f6fa34c-88ed-4442-9da3-fefde4ebc45f/2008-12-12_2345.png" width="144" height="167" border="0" /></a></htm>
 
  
*Right click the new folder and select '''svn checkout...''':
+
==Syntax==
<htm><a href="http://content.screencast.com/users/GRiflet/folders/Jing/media/4acf6039-649c-45bb-928e-01918aae78c5/2008-12-12_2347.png"><img src="http://content.screencast.com/users/GRiflet/folders/Jing/media/4acf6039-649c-45bb-928e-01918aae78c5/2008-12-12_2347.png" width="319" height="282" border="0" /></a></htm>
+
to get the code from the command line. Useful when building scripts...
 
 
*Set the central server repo address as '''https://davinci.maretec.ist.utl.pt:8443/svn/mohid_net/trunk/''', then click '''ok''':
 
<htm><a href="http://content.screencast.com/users/GRiflet/folders/Jing/media/06a40ea8-f46b-48af-9b34-86a5b11045fd/2008-12-12_2350.png"><img src="http://content.screencast.com/users/GRiflet/folders/Jing/media/06a40ea8-f46b-48af-9b34-86a5b11045fd/2008-12-12_2350.png" width="456" height="313" border="0" /></a></htm>
 
 
 
*Insert your subversion user name and password. Then click '''ok'''.
 
 
 
*Get the files, and when it's done click '''ok''':
 
<htm><a href="http://content.screencast.com/users/GRiflet/folders/Jing/media/7d6a56a6-3e33-4527-b189-18315b03b85c/2008-12-12_2353.png"><img src="http://content.screencast.com/users/GRiflet/folders/Jing/media/7d6a56a6-3e33-4527-b189-18315b03b85c/2008-12-12_2353.png" width="554" height="295" border="0" /></a></htm>
 
<htm><a href="http://content.screencast.com/users/GRiflet/folders/Jing/media/f7b0967a-5921-44cf-b1c4-1d37fb798b70/2008-12-12_2354.png"><img src="http://content.screencast.com/users/GRiflet/folders/Jing/media/f7b0967a-5921-44cf-b1c4-1d37fb798b70/2008-12-12_2354.png" width="554" height="295" border="0" /></a></htm>
 
 
 
*That's it! You've imported the whole project!
 
 
 
===Getting the latest version of the code===
 
*To refresh and get the latest version of the code simply right-click on your local-repository, and then select the '''SVN''' update option:
 
<htm><a href="http://content.screencast.com/users/GRiflet/folders/Jing/media/fd71f89d-7196-4692-9cea-cdc355d12563/2008-12-13_0005.png"><img src="http://content.screencast.com/users/GRiflet/folders/Jing/media/fd71f89d-7196-4692-9cea-cdc355d12563/2008-12-13_0005.png" width="347" height="173" border="0" /></a></htm>
 
 
 
*Once the new files are downloaded, simply hit the '''ok''' button.
 
<htm><a href="http://content.screencast.com/users/GRiflet/folders/Jing/media/90f1515b-6567-4fed-a649-867c869292c6/2008-12-13_0007.png"><img src="http://content.screencast.com/users/GRiflet/folders/Jing/media/90f1515b-6567-4fed-a649-867c869292c6/2008-12-13_0007.png" width="554" height="295" border="0" /></a></htm>
 
 
 
*That's it!
 
 
 
===Commiting changes to the code===
 
*Now whenever you feel like to commit your changes, if any (provided that you are granted the rights to do so - ask the mohid code administrators for a user name and the write permission), simply right click the subversioned folder, and click '''Svn commit...''':
 
<htm><a href="http://content.screencast.com/users/GRiflet/folders/Jing/media/88ac4303-c3e3-4e3c-9dde-fb9b71a2ab96/2008-12-12_2359.png"><img src="http://content.screencast.com/users/GRiflet/folders/Jing/media/88ac4303-c3e3-4e3c-9dde-fb9b71a2ab96/2008-12-12_2359.png" width="333" height="226" border="0" /></a></htm>
 
  
*Make sure you log all your changes, then click '''ok''':
 
<htm><a href="http://content.screencast.com/users/GRiflet/folders/Jing/media/65bf3ea1-8602-4ffd-91a1-32d673472560/2008-12-13_0001.png"><img src="http://content.screencast.com/users/GRiflet/folders/Jing/media/65bf3ea1-8602-4ffd-91a1-32d673472560/2008-12-13_0001.png" width="458" height="482" border="0" /></a></htm>
 
 
*And... it's done!
 
<htm><a href="http://content.screencast.com/users/GRiflet/folders/Jing/media/23fef85f-ca27-4535-86f7-835fed32d7d7/2008-12-13_0004.png"><img src="http://content.screencast.com/users/GRiflet/folders/Jing/media/23fef85f-ca27-4535-86f7-835fed32d7d7/2008-12-13_0004.png" width="554" height="295" border="0" /></a></htm>
 
 
==Syntax==
 
 
===Importing new tree===
 
===Importing new tree===
 
Do this when you want to kick-start a new google code project ...
 
Do this when you want to kick-start a new google code project ...
Line 70: Line 37:
 
===Listing files in project===
 
===Listing files in project===
 
  > svn ls -R http://someproject.googlecode.com/svn/trunk/
 
  > svn ls -R http://someproject.googlecode.com/svn/trunk/
 +
 +
===More commands===
 +
*[http://articles.slicehost.com/2007/9/5/introduction-to-subversion An introduction to subversion.]
  
 
==Syncing method==
 
==Syncing method==
Line 101: Line 71:
  
 
NOTE: The first time you run the file, you'll be prompted for a password.
 
NOTE: The first time you run the file, you'll be prompted for a password.
 +
 +
==Installing svn server in linux==
 +
 +
> sudo yum install subversion tracd
 +
  
 
==External References==
 
==External References==
 +
*[http://svnbook.red-bean.com/nightly/en/index.html Great book on Subversion]
 
*[http://subversion.tigris.org/ Subversion homepage],
 
*[http://subversion.tigris.org/ Subversion homepage],
 
*[http://tortoisesvn.tigris.org/ Tortoise svn].
 
*[http://tortoisesvn.tigris.org/ Tortoise svn].
 
*[http://code.google.com Google code]. Good for hosting svn repos.
 
*[http://code.google.com Google code]. Good for hosting svn repos.
 +
*[http://trikks.wordpress.com/2010/06/15/setup-a-subversion-svn-server-in-debian/ Great document on how to install a svn server.]
 +
 +
===Mohid subversion workshop documents===
 +
*[http://docs.google.com/Doc?id=ddc79s84_573dxd57vg2 Workshop program and notes].
  
 
[[Category:Windows]]
 
[[Category:Windows]]
 
[[Category:Linux]]
 
[[Category:Linux]]
 
[[Category:Tools]]
 
[[Category:Tools]]
 +
[[Category:Svn]]

Latest revision as of 15:48, 21 June 2013

Subversion is the hottest version control system available in the free world.

The Mohid subversion repositories

Intranet repositories addresses

The intranet repository is deprecated and should not be used anymore... See instead codeplex.

Internet (read-only) repositories addresses

The official repository is at the Codeplex.

GUI clients

To quickly download the code please install a gui client. Choose your flavour:

  • RapidSvn, very similar environment to source-safe, for windows, linux and mac.
  • TortoiseSvn, elegantly inserts itself into your windows explorer environment (windows only).

Syntax

to get the code from the command line. Useful when building scripts...

Importing new tree

Do this when you want to kick-start a new google code project ...

> svn import https://myproject.googlecode.com/svn/trunk/ --username USER -m "Initial import"

Checkout project

> svn checkout https://myproject.googlecode.com/svn/trunk/ myproject --username USER

Get latest version

First retrieval:

> svn checkout http://someproject.googlecode.com/svn/trunk/ someproject

Routine retrieval:

> svn update someproject

Commiting project

> svn commit -m "Some comment" --force-log someproject

Listing files in project

> svn ls -R http://someproject.googlecode.com/svn/trunk/

More commands

Syncing method

Svn can be used in very inventive ways. One of them is to use google code hosting services to keep your favorite tools' configuration files. Here below we give an example of how to keep in-sync your Opera profile.

Pre-requisites:

  • An svn client,
  • A web-based svn repository.

windows

Here's a batch file that allows to sync your opera profile. The same batch file is a little bit more detailed in the Opera article in this wiki.

REM OperaSync2.bat
@echo off

set TARGET=C:\Documents and Settings\Guillaume\Application Data\Opera\Opera\profile
set PROG=Opera
set EXEC=C:\Programas\Opera\%PROG%.exe
set REPO=https://preopmodel.googlecode.com/svn/trunk/%PROG%Sync
set USER=

echo Checking out from %REPO% ...
svn checkout %REPO% "%TARGET%" --username %USER%
echo %PROG% running ...
%EXEC%
echo Commiting to %REPO% ...
svn commit -m --force-log "%TARGET%"
echo Done.

@echo on

NOTE: The first time you run the file, you'll be prompted for a password.

Installing svn server in linux

> sudo yum install subversion tracd

External References

Mohid subversion workshop documents