Difference between revisions of "Svn"
From MohidWiki
m (1 revision) |
|||
Line 1: | Line 1: | ||
[http://subversion.tigris.org/ Subversion] is the hottest version control system available in the free world. | [http://subversion.tigris.org/ Subversion] is the hottest version control system available in the free world. | ||
+ | |||
+ | ==GUI clients== | ||
+ | Simply install presto the tortoise svn [http://tortoisesvn.tigris.org/ Tortoise svn]. | ||
+ | |||
+ | ===Creating a new local repo=== | ||
+ | Here's the quick how-to add a new '''mohid_net''' project from our local intranet repository: | ||
+ | *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...''': | ||
+ | <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> | ||
+ | |||
+ | *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== | ==Syntax== |
Revision as of 00:08, 13 December 2008
Subversion is the hottest version control system available in the free world.
Contents
GUI clients
Simply install presto the tortoise svn Tortoise svn.
Creating a new local repo
Here's the quick how-to add a new mohid_net project from our local intranet repository:
- Create a new folder:
- Right click the new folder and select svn checkout...:
- Set the central server repo address as https://davinci.maretec.ist.utl.pt:8443/svn/mohid_net/trunk/, then click ok:
- Insert your subversion user name and password. Then click ok.
- Get the files, and when it's done click ok:
- 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:
- Once the new files are downloaded, simply hit the ok button.
- 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...:
- Make sure you log all your changes, then click ok:
- And... it's done!
Syntax
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/
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.
External References
- Subversion homepage,
- Tortoise svn.
- Google code. Good for hosting svn repos.