日期:2014-05-17  浏览次数:20678 次

[转]在windows下安装SubVersion

前几天装SubVersion,在google上搜了一把,按国内的帖子的步骤,总报SVN_EDITOR找不到的错,无奈只好放下了。今天硬着头皮看了下老外写的安装指南,一下搞定,原来前几天搜的帖子少了增加SVN_EDITOR为环境变量的步骤。今天把老外的帖子转到这来。

  1. Download everything
    1. Go to http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91?and download the most recent svn-x.y.z-setup.exe. At the time of this writing, the latest version was svn-1.4.4-setup.exe. 我安装的时候只用了1.4.4下面的软件都没装。
    2. Go to http://dark.clansoft.dk/~mbn/svnservice/?and download SVNService.zip.
    3. Go to http://tortoisesvn.tigris.org/download.html?and download the most recent installer. At the time of this writing, the latest version was TortoiseSVN-1.1.7-UNICODE_svn-1.1.4.msi. (It doesn't have to be the exact same version as the svn installer you got in step 1. See the compatibility chart.)
  2. Install the server and the command-line client
    1. Run svn-x.y.z-setup.exe and let it install stuff.
    2. Go to Control Panel > System, go to the Advanced tab, and click the "Environment Variables" button at the bottom. Click the "New" button (either one, but if you're undecided, use the one under "System variables"), set "variable name" to SVN_EDITOR, and "variable value" to the path and filename of a text editor of your choice (e.g., C:\Windows\Notepad.exe). OK all the way out.
  3. Create a repository and configure access
    1. Create a new directory somewhere out of the way; this is where your repository will live, but you'll almost never actually open the files directly. I made a directory called svn_repos directly under my C:\Documents and Settings, just so it'd be out of the way.
    2. Open a command prompt and type: svnadmin create "C:\Documents and Settings\svn_repos"
    3. In Windows Explorer, browse to the C:\Documents and Settings\svn_repos\conf directory (which svnadmin just created for you), and edit a couple of config files:
      1. Open the svnserve.conf file in a text editor, and uncomment the [general], anon-access = read, auth-access = write, and password-db = passwd lines. Save.
      2. Open the passwd file in a text editor, uncomment the [users] line, and add the username and password you want to use when connecting to your subversion server. Save.
  4. Start the server manually, and create a project
    1. In your command window, type: svnserve --daemon --root "C:\Documents and Settings\svn_repos"
    2. Open a second command window, and type svn mkdir svn://localhost/monkey
    3. You'll see the text editor you specified in step II.2, with some text already in it. Type a comment, like "Created the monkey project", at the beginning of the file (before the line starting with "--"). Save the file and close the editor.
    4. If your Subversion login is the same as your Windows login, then type your password (the one you put in the passwd file) at the prompt, and hit Enter. If your Subversion login is different from your Windows login, then just hit ENTER at the password prompt, and Subversion will then ask for both your login and your password.
    5. Subversion should tell you that it "Committed revision 1." Congratulations! You just checked a change into Subversion. Throw yourself a party. (Yes, creating a directory is a revisioned change — you can go back and get the repository as of a time before that directory existed. This is novel stuff for folks like me who still use VSS at work.)
    6. It's conventional to have /trunk, /branches, a