`
xplazy
  • 浏览: 44859 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Subversion & TortoiseSVN Installed(转)

阅读更多

Subversion & TortoiseSVN: Installed and started on Windows 2003 server and local machines

Subversion 使用介绍

Introduction

In this article I will walk through the process of installing Subversion and getting started using this very useful version control tool. I chose Subversion based on its ease of use and understanding, the documentation provided is very easy to understand and navigate through, also you can't beat the cost - FREE.

I've laid out this article in a step by step method using the practices that I feel give the best results for my situation, there are always ways to customize this process and I will mention some of these as the steps progress.

Notes:

To clarify some terminology -

  • When I mention 'Explorer' or 'explorer' I'm referring to the Windows file manager.
  • Subversion will be referred to as SVN
  • TortoiseSVN will be referred to as TSVN

    Some of the pictures in this article have been resized.

    I've written this article with the beginner in mind, some of the steps and images may seem redundant and unnecessary but I included them so that there would be as little confusion as possible.

    The names and aliases used in this article can and probably should be changed to meet your needs.

    *There is a One-Step process that installs SVN, TSVN, sets up the service, downloads the documentation, and creates the first repository - http://svn1clicksetup.tigris.org/ I didn't take this route because I wanted a little more control and understanding of what I was putting on my machines.

    Quick Reference Links

    Now to Business

    I. The first thing I recommend is getting yourself a copy of the most recent Subversion Manual. This will be good for future reference when you want to get more involved with the finer points. http:\\svnbook.red-bean.com\ , I recommend the .pdf version as this will allow you to save a copy to your desktop, you can also download a one page HTML of the same documentation.

    II. Once you have a copy of the manual on your local desktop it's time to get started with the install. RDC (Remote Desktop Connect) to the server, or log into the server directly and navigate out to the SVN download page http:\\subversion.tigris.org\servlets\ProjectDocumentList?folderID=91

    a. From this site select the most recent version of the SVN .exe installer for Windows (svn-1.4.2-setup.exe at the time of this article)

    III. Run the .exe on the server

    a. Follow the prompts to install SVN on the server

    b. Accept the license agreement

    c. Select the destination of SVN on the server:

    d. Accept the Start menu shortcut 'Subversion'

    e. Allow the documentation links to be posted to the server

    *Note – At the time of this article the documentation that is posted is from SVN version 1.3, but most of the data presented is current with the exceptions of the latest additions. The documentation is still good for use as a reference.

    f. Click 'Install' -> 'Next' -> Finish, and you've just installed SVN to the server. Easy, huh?

    IV. The next step in the installation process will set up the log editor for SVN

    a. Click Start -> select the Control Panel -> System

    b. Select the 'Advanced' tab -> Environment Variables

    c. Click 'New' under System Variables

    d. Set the variable name to SVN_EDITOR

    e. Set the Variable Value to C:\Windows\notepad.exe

    i. This is the default text editor for logs in SVN

    f. Click 'OK' out of the menus

    V. Setting up SVN as a service on the server

    a. First download the .zip file that contains the needed files – http:\\www.stanford.edu\~bsuter\subversion-setup-guide\SVNService.zip

    b. Open the zip file and select the file SVNService.exe

    i. Click Edit -> Move to Folder -> Browse to C:\Program Files\Subversion\bin


    **It's absolutely critical that this file be place here as it needs svnserve.exe to run properly. The other files are not needed for the service to run but you can extract them to the bin file as well for a reference.

    c. Open a Command Window

    d. Enter 'svnservice –install –daemon - - root "d:\AppRepositories

    i. This sets the service to run in the background (daemon) and sets the root directory to the file that holds the repositories (d:\AppRepositories).

    e. SVN is now set up as a service

    f. Now that SVN is set up as a service on the server you can access it programmatically from the command line and later the TSVN interface using the following format - svn://(ServerName)/(RepositoryName)/ProjectSource/trunk

    **Notice that the actual drive (D:/) as well as the folder holding the repositories (AppRepositories) are missing from the command, this is now using the 'root' that was specified in the service creation command.

    g. Now to further configure the service go to Start -> Control Panel -> Administrative Tools -> Services

    h. Navigate down to SVNService and double click the service. Change 'Startup type:' from manual to Automatic


    i. Now SVN will start every time the server boots up.

    j. Back in the services screen, click 'Start' in the upper left of the right pane OR click the 'play' icon in the menu tool bar to start the service

    k. Close the window and you've implemented SVN as a service.

    VI. Uninstall the SVN service

    a. Open a Command Window

    b. Enter 'svnservice –remove'

    c. This command will both stop and remove the service from the directory

    VII. Creating a repository using the SVN command line

    a. First thing, open a command prompt window

    b. Next create a folder on the D: drive to house all the repositories

    i. 'mkdir d:\AppRepositories'

    c. Within this folder place all project repositories.
    **It is possible to place several projects within the same repository but I would not recommend this as there is a chance to get some of the code mixed or replaced inadvertently. It might be beneficial to do this if the repositories that will be grouped are similar in style or use the same resources.

    d. Also create a folder within the AppRepositories directory named 'config'. This folder will hold the shared passwd file for all subsequent repositories. **This step is not necessary but it makes manageability much easier.

    i. 'mkdir d:\AppRepositories\config'

    ii. **We'll put the passwd file into this new folder a few steps down the road, when we set up the repositories' configuration.

    e. Now create the first repository, I recommend using the same name for the project as the repository name.

    i. 'svnadmin create d:\AppRepositories\((ProjectName))'

    f. Once the repository has been created we'll need to create another folder within the repository itself to hold the working directory of the project. I've added the subsequent folders for my own benefit as I feel that this method makes it easier to understand.

    i. 'svn mkdir file:\\\d:\AppRepositories\((ProjectName))\ProjectSource'

    ii. This subfolder is needed to house the trunk, branches, and tags folders that actually hold the working code. The main repository ((ProjectName)) will still handle the versioning of the project. This folder and those created in the next few steps will need to be created for all repositories.

    iii. The trunk folder is where you will store the source code, or working code. The tags folder is used to hold 'snapshots' of the project, i.e. to present version 1.0.22. The branches folder is used to hold the branches of the project, basically the same code but with different functionality, i.e. taking the application in a new direction.

    g. Upon creation of the 'ProjectSource' folder a log file will appear in notepad

    **On the top line above the '- -' enclosed line enter a description of the action, i.e. 'Initial creation of the projectsource folder to hold trunk, branches, and tags source folders.'

    h. Click File -> Save -> close notepad

    i. Once the log has been saved and closed the command prompt will display 'Committed revision 1'. Each subsequent change made will be a revision to the repository.

    j. Now create the trunk, branches, and tags folders

    i. 'svn mkdir file:\\\d:\AppRepositories\((ProjectName))\ProjectSource\trunk'


    **On the top line of the log file above the '- -' enclosed line enter a description of the action, i.e. 'Initial creation of the trunk folder.'

    ii. This is revision 2

    iii. 'svn mkdir file:\\\d:\AppRepositories\((ProjectName))\ProjectSource\branches'


    **On the top line of the log file above the '- -' enclosed line enter a description of the action, i.e. 'Initial creation of the branches folder.'

    iv. This is revision 3

    v. 'svn mkdir file:\\\d:\AppRepositories\((ProjectName))\ProjectSource\tags'


    **On the top line of the log file above the '- -' enclosed line enter a description of the action, i.e. 'Initial creation of the tags folder.'

    vi. This is revision 4

    k. All the necessary folders are now created and in place. The next step is to configure access to the repository. **This step can also be done right after creating the repository

    l. Open an explorer window and browse to D:\AppRepository\((ProjectName))\conf

    **Note: you will not see the files just added in the explorer window (ProjectSource, trunk, branches, tags) but not to worry they are there but stored in the repository at their respective revisions and still available for access.

    m. With the conf file open make a copy of the passwd file and paste it into the config file of AppRepositories that we created earlier.

    i. **This step is not necessary, each repository can have its own list of users with their passwords. If you elect to use this method skip to step r.


    n. Open the svnserve.conf file.

    **If prompted to select which application to view this document in, choose notepad.

    o. Under the [general] section, uncomment the auth-access, anon-access, and password-db lines.

    i. Delete the '#' symbols, be sure to leave no spaces on the line before the start of the text.

    p. Set password-db = '..\..\config\passwd'. This will set the authentication path to the shared passwd file.

    q. Click File-> Save -> close the window

    r. Now, open the passwd file in the config folder. **When prompted select notepad as the application to use to view the file.

    s. Under the [users] section delete the sample users

    t. Enter the users that will have access to this repository in the form of username = userpassword. **again make sure that there are no spaces before the first character of text.

    i. This will be the only time other than adding new users that you will need to modify the \config\passwd file. Unless of course you're modifying the passwd file for each repository.

    u. Click File -> Save -> close the window.

    VIII. Create a repository using TSVN on the server

    a. TSVN is not necessary at the server level as it is pretty much an end user tool but for the sake of completeness I'm including it here. I personally feel that creating repositories with TSVN is easier than using the command lines.

    b. First go to http:\\tortoisesvn.net\downloads

    c. Download the latest version of TSVN to the server (1.4.3.8645 at the time of this article)

    d. Run the 32-bit installer or 64-bit if this is how your server is configured.

    e. Accept the license agreement -> Click Next

    f. Accept the default icon tree and location of TSVN -> Click Next

    g. Click Install

    h. When finished installing unselect the 'View Change Log' and click Finish.

    i. TSVN requires the system to reboot, close all windows and then select 'Yes' to reboot now

    i. Once the system has successfully rebooted, RDC back into the server or reconnect into the system and open an explorer window.

    j. Navigate out to the D:\ drive and right-click in the right pane of the window and create a new folder that will house all the repositories. Name the folder 'AppRepositories'.

    k. Open the folder and repeat the folder creation process, this time name the folder the same as the project you intend to version. i.e. 'BrushLog'. Also create a folder with the name 'config', that will hold the shared passwd file.

    l. Right-Click on the project folder and roll down to TortoiseSVN> -> and click 'Create repository Here'

    m. In the first prompt window select 'NativeFileSystem(FSFS)

    i. **I highly recommend using this system for its flexibility and compatibility

    n. Click OK, and the repository is now created.

    o. Next create the working directory folder by opening the repository folder and right-clicking the right pane of the window and create a new folder that will house trunk, branches, and tags folders. Name the folder 'ProjectSource'.

    p. Open the ProjectSource folder and in the right window create three new folders named: trunk, branches, and tags.

    q. Open the svnserve.conf file. **If prompted to select which application to view this document in, choose notepad.

    r. Under the [general] section, uncomment the auth-access, anon-access, and password-db lines.

    i. Delete the '#' symbols, be sure to leave no spaces on the line before the start of the text.

    s. Set password-db = '..\..\config\passwd'. This will set the authentication path to the universal passwd file.

    t. Click File-> Save -> close the window

    u. Now we will need to configure the authentication for the repositories. Open the conf folder in the repository you just created and copy the passwd file to the config folder under the AppRepositories directory.


    v. Open the passwd file, when prompted select notepad as the application used to view the file.

    w. Under the [users] section delete the sample users. Be sure to leave no spaces between the text and the start of the line. Enter the name and password for the users that will have access to the repositories in the form of username = userpassword.

    i. This is the only time that you will need to change this file with the exception of adding new users. Unless you've elected to use separate passwd files for all repositories.

    x. The process of creating a repository is now completed using TSVN, note also that in using this method no revisions were completed while adding the files. Also the files are visible within the explorer window.

    IX. Install TSVN on client machines

    a. First go to http:\\tortoisesvn.net\downloads

    b. Download the latest version of TSVN to the computer (1.4.3.8645 at the time of this article)

    c. Run the 32-bit installer or 64-bit depending on the machine

    d. Accept the license agreement -> Click Next

    e. Accept the default icon tree and location of TSVN -> Click Next

    f. Click Install

    g. When finished installing unselect the 'View Change Log' and click Finish

    i. TSVN requires the system to reboot, close all windows and then select 'Yes' to reboot now

    X. Loading source code to a repository using TSVN

    **Note: Before going on be sure you've completed section IX, a repository must be in place to import

    a. Open an explorer window and browse to the folder containing the source code

    b. Right-click the folder -> TortoiseSVN> -> Import

    i. When using TSVN import(to the server) in this case means the same as export(from the client). This confused me in the beginning.

    c. Enter 'svn:\\(servername)\(NameOfRepository)\ProjectSource\trunk' into the Url of repository. You can add a description of the import action in the Import Message window, i.e. Initial import of the (ApplicatioName) source code.

    d. At the prompt enter the username and password entered into the passwd file from the repository conf file. This only needs to be done once per session, SVN and TSVN will remember the entries for the duration of the session. Unless you've used separate passwd files, then you'll have to repeat this for each new repository.

    e. Click OK and all the files are loaded into the repository and committed at the next revision number (revision 1(TSVN) or 5(SVN command line) depending on the method used to create the repository)

    **Note: The total number of files imported is also displayed at the bottom of the window.

    XI. Creating a local working directory from a repository

    a. Open a windows explorer and browse to the C:\ drive, right-click the right pane and create a new folder. Name the folder SVN.

    b. Open the SVN folder, right-click in the right pane and create a new folder with the same name as your repository

    c. Right-click the new folder -> SVN Checkout

    d. In the 'Url of repository' enter 'svn:\\(ServerName)\(RepositoryName)\ProjectSource\trunk'

    **Note: In the bottom section of the window it is possible to specify a previous revision of the project by specifying a revision number. The default is the latest committed version.

    e. Click OK

    f. This adds all the source code at the current(most recent) revision. The window shows the total number of files added to your directory (Added: ##) and the revision number.


    **Note: Every file in this folder has a green check icon on it, this means that this file appears as is from the repository. This icon will change if the file is modified to a red '!' and will remain thus until the file is committed back to the repository on the server.

    g. You've now got a working copy of the source code that you can modify, change, or reinvent at your leisure with no worries about 'accidentally' losing everything.

    XII. Committing changes back to the repository

    a. When you're ready to save your changes back to the repository browse out to the working directory and right click the folder -> SVNCommit

    **Notice that all the changed files are marked with a red '!', this is just TSVN's way of letting you know you've done some work.

    b. TSVN allows you to select which file you'd like to commit back into the repository, either a single control, many code pages, or the entire working code.

  • You can commit any files you choose (not always all of them), but when you commit the files you selected, they are all committed or not at all (When an error occurs for example). *(SDragon42, 3/23/07)*

    i. If you are working on a project as part of a team and other members have checked out and checked back in code before you complete yours and your code is not compatible TSVN will display an error. At this point I recommend right-clicking the folder -> TSVN -> Check-for-Modifications. For more on the capabilities of TSVN see the manual.

  • ** Simply checking for changes made to the files is not sufficient to have a compatible working compilation, an Update is required on the working copy to get the latest code from the repository. *(SteveKing, 3/23/07)*

    **Note: A cool feature of TSVN is that when you're ready to commit the changes back to the repository all the files that are being sent appear in the lower part of the commit window, and by double-clicking a particular file you can see what exactly was changed between revisions.

    ii. Click OK

    iii. Enter your username and password from the passwd file

    iv. All the changed files are now updated in the repository and loaded into the next revision. The revision number is displayed in the window. Each revision holds all the files for each project; the difference is what is displayed below.

    Conclusion

    Up to this point you have come far enough to use the basic functionality of SVN with TSVN. Of course there is lots more that can be done with SVN and maybe I'll cover that in a later article, but until then everything is in the documentation that you've downloaded.

    Getting the ball rolling is the hardest part of using SVN, once you start incorporating it into your development cycle you'll realize just how easy and beneficial these tools are.

  • Credit where Credit is due

    This article would not be what it is without some help and guidance from some who are more experienced and knowledgeable than myself. First let me thank the CP community for being the supportive and encouraging place that it is for programmers. Second I have a couple shout outs to two individuals that helped me to get not only this article off the ground by providing very poignant research direction but also to complete the work that led to the article in the first place.

    • Hans Dietrich - for providing very well written articles and suggestions
    • code-frog - for getting me started in the right direction

    History

    Initial article submission - version 1.0

  • Errors in text changed - version 1.1

  • Grievous lack of acknowledgement taken care of - version 1.2

  • <!----> <!---->

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

     

     

    增加生成server 的windows command.

     

    sc create svnservice4 binpath= "\"d:\Program Files\svn-win32\bin\svnserve.exe\" --service --listen-port 9999 -r E:\personal\live\rep" displayname= "SVNService4" depend= Tcpip

     

    分享到:
    评论

    相关推荐

      subversion1.8 & TortoiseSVN1.8

      TortoiseSVN 是 Subversion 版本控制系统的一个免费开源客户端,可以超越时间的管理文件和目录。文件保存在中央版本库,除了能记住文件和目录的每次修改以外,版本库非常像普通的文件服务器。你可以将文件恢复到过去...

      Subversion和TortoiseSVN的安装与配置

      TortoiseSVN则是Subversion的一个图形化客户端,它为Windows用户提供了友好的界面,使得版本控制操作更加直观易用。下面我们将详细介绍Subversion和TortoiseSVN的安装与配置过程。 一、Subversion的安装 1. 获取...

      Subversion以及TortoiseSVN安装包

      Subversion和TortoiseSVN是两个在软件版本控制领域非常重要的工具,它们主要用于管理和跟踪代码库的变化。Subversion是一个开源的版本控制系统,而TortoiseSVN则是Subversion的一个图形化界面客户端,专为Windows...

      apache和Subversion及TortoiseSVN安装配置

      Apache、Subversion(SVN)和TortoiseSVN是软件开发中用于版本控制和协作的重要工具。Apache作为Web服务器,Subversion是一个集中式的版本控制系统,而TortoiseSVN则是Subversion的一个图形化客户端,使得用户在...

      git&TortoiseGit&TortoiseSVN安装包

      TortoiseGit和TortoiseSVN则是图形化的客户端工具,它们为Git和Subversion(SVN)提供了友好的Windows资源管理器集成界面,使得在Windows环境下使用这两种版本控制系统变得更加方便。 **Git** Git的核心概念包括...

      Apache+ subversion+tortoiseSVN安装手册

      Apache、Subversion 和 TortoiseSVN 是用于版本控制系统的重要组件,尤其在软件开发团队中广泛使用,便于协作和代码管理。下面将详细介绍这三个组件以及如何进行安装。 **Apache Subversion (SVN)** Apache ...

      SVN-subversion-tortoiseSVN.7z

      2. **TortoiseSVN的安装程序**:TortoiseSVN的安装程序通常会提供一个向导式的界面,指导用户进行安装,设置环境变量,以及配置与Subversion服务器的连接。 3. **文档和教程**:压缩包中可能包含Subversion和...

      TortoiseSVN_zh_CN.rar_Subversion_TortoiseSVN

      《构建版本控制系统:Apache + Subversion + TortoiseSVN详解》 版本控制系统是软件开发中的重要工具,它能够帮助开发者追踪代码的修改历史,管理团队协作,以及方便地回滚到任何历史版本。Subversion(简称SVN)是...

      Subversion客户端TortoiseSVN简单使用指南

      ### Subversion客户端TortoiseSVN简单使用指南 在软件开发过程中,版本控制工具是必不可少的,它能够帮助团队管理代码的变化,确保项目的稳定性和可追溯性。Subversion(SVN)作为一款开源的集中式版本控制系统,在...

      subversion+apache+TortoiseSVN安装说明

      【Subversion + Apache + TortoiseSVN 安装说明】 Subversion 是一个开源的版本控制系统,Apache 是一款广泛应用的Web服务器,TortoiseSVN 是一个 Windows shell 接口,用于 Subversion。以下是对安装过程的详细...

      Subversion和TortoiseSVN

      Subversion和TortoiseSVN很好用的svn服务器,很多企业都在用,很方便管理代码

      SVN(含Subversion1.6.6 TortoiseSVN1.6.6 汉化包 配置教程).rar

      这个“SVN(含Subversion1.6.6 TortoiseSVN1.6.6 汉化包 配置教程).rar”压缩包包含了Subversion 1.6.6版本以及TortoiseSVN 1.6.6的汉化版和配置教程,非常适合中国用户使用,避免了语言障碍,提高了工作效率。...

      最新SVNServer3.6.0&TortoiseSVN1.9.5&中文包_20170325_CLeopard

      在这个场景中,我们关注的是两个重要的工具:SVN Server(Subversion 服务器)3.6.0 和 TortoiseSVN 1.9.5,这两个工具都是基于 SVN(Subversion)协议的。SVN Server 是用于存储和管理代码仓库的服务器端程序,而 ...

      版本控制软件subversion及TortoiseSVN快速入门培训教程

      版本控制软件subversion及TortoiseSVN快速入门培训教程(兼有协同工作功效)(3.1M 解压缩后用wps2005或powerpoint都可以打开) &lt;br&gt;http://www.cuteser.com/train/softTrain.htm

      Windows下Subversion_TortoiseSVN_EclipseSVN插件的安装与升级.doc

      Windows下Subversion_TortoiseSVN_EclipseSVN插件的安装与升级.doc

      subversion-TortoiseSVN-使用手册(CHM+HTML,中英完整版)

      3. TortoiseSVN是完全免费的! 4. 社区 5. 致谢 6. 本文使用的术语 1. 简介 1.1. 什么是TortoiseSVN? 1.2. TortoiseSVN的历史 1.3. TortoiseSVN的特性 1.4. 安装TortoiseSVN 1.4.1. 系统要求 1.4.2. 安装 1.4.3. ...

      SVN服务端subversion 客户端tortoiseSVN详细使用手册

      #### SVN(Subversion)与tortoiseSVN简介 Subversion(简称SVN)是一种开源版本控制系统,用于跟踪随时间变化的文件和目录,它能记录每一次的更改,以便用户能够回溯到历史的任意版本。tortoiseSVN则是SVN的一个...

      版本管理Setup-Subversion1.8和TortoiseSVN-1.8

      Subversion(简称SVN)是其中一款广泛使用的开源版本控制系统,而TortoiseSVN则是一个与之集成的Windows Shell界面客户端。在本主题中,我们将深入探讨"版本管理Setup-Subversion1.8和TortoiseSVN-1.8"在Windows 10...

      版本控制:Subversion和TortoiseSVN的配置

      1.Subversion和TortoiseSVN是什么?Subversion是什么,我想如果不知道的话就没有必要看这篇文章了:》它是一个被设计用来替代cvs的版本控制工具,至于版本控制在程序开发过程中的重要性,我想,编过程序的人都应该...

      SVN+TortoiseSVN+Slik-Subversion+site-1.0.6

      2. **安装TortoiseSVN**: 安装TortoiseSVN客户端,它将与Slik-Subversion配合工作,提供图形化的界面进行版本控制操作。确保在安装过程中关联Windows资源管理器,这样在文件和文件夹上就能看到SVN的图标和右键菜单。...

    Global site tag (gtag.js) - Google Analytics