SVN's local way: good way for personal source management
[Mental Studio] Raptor [blog]
SVN, LOCAL mode, personal source management
Today is in the QQ group, some people are in listening to Delphi's VSS plug-in, so they have been b4. Just trying to tried SVN recently, it feels very good, so I recommend it in the group so that it is almost considered to be SVN. -_- |||
In fact, SVN is indeed the best source management tool I have ever used. Although this type of tool I have used is not much, only VSS, CVS and SVN, others like PVCS, TeamSource, Clearcase, because they They are commercial products, and are usually used to manage large projects, there is no opportunity to try, so I don't know how they. VSS is the earliest source management tool I have been used in the company four years ago, but it is too general, and it is also commercial products. Therefore, in addition to the company's work needs, I am not used by myself. After coming from the company, I tried CVS, which started to manage my source code. As the source management tool for the OSS circle, I don't have to say more. But now SVN, this new star has gradually been able to cover the light of CVS, and it can be seen that SVN has his own killer. It is also important to: it is also an open source free software.
SVN full name Subversion. SVN is the same as CVS, is a cross-platform software that supports most common operating systems. This article only discusses the situation of Windows. Its official website is: http: //subversion.tigris.org (TiGris is an open source website similar to SourceForge, unlike sf, the CVS service provided by the sf, while TiGris is provided with an SVN service).
Before introducing SVN applications, discuss an important basic concept of source code management: Repository. Repository is the centralized storage of the source code. The source code submitted after all modifications is saved here and record all modified versions, branch versions, versions, and concurrent modification processing. Both traditional VSS or CVS are similar to C / s applications, with a separate server to do these jobs. The SVN is much flexible, it supports three ways: stand-alone server mode, web server mode (this is not available in CVS) and this article will focus on the local way.
Back to the topic. Personal Source Management is a concept I have given to distinguish between the source code management of the team. Originally like VSS, CVS, SVN is the most important function for the team development, version control and concurrent modification of the source code modification. But for personal development, there is no problem with concurrent conflict. However, personal development has some new issues: General individual does not have a unwanted server to do repository, so even if it is used, it is also used, and the server client is on a machine, and does not need users. Permission management This function is managed. But sometimes you need to develop source code between different machines, which brings a potential risk of version chaos. The Local method of SVN can be said to be the best solution.
My current usage is: I have established repository in the U disk, and then I installed SVN on each machine so I didn't need a separate Repository server, as long as I put the U disk on any machine. Complete version control function.
SVN installation and use.
Because this article only discusses the local way under Windows, there is no need to stand alone server or web server. SVN's client and CVS are also a command line mode. But under the Windows platform, we have some other choice, this is a good use: TortoiseSVN (Note: This is an independent of SVN project, similar to the relationship between WinCVS and CVS). Its official website is: http://www.tortoisesvn.org, download its installer: TortoiseSVN-1.1.3-Unicode_svn-1.1.3.msi (this file name refers to NT / 2K / XP version). This integrated release package contains all the contents needed for Local applications. If you want the Chinese version, you can download this Chinese language package: languagePack_1.1.3_zh_cn.exe (this is a Simplified Chinese Pack, BTW: From the progress, the completion of traditional Chinese is also higher: P). As for other such as independent server, web server mode, command line, Python support, etc., you have to provide the corresponding installation package, you can refer to the SVN website description download installation. The installation process is very simple, just after the installation is complete, it must be restarted because it is integrated into the resource manager of Windows. This can also be another big advantage of SVN (Thank Mikeshi pointed out: CVS also has a TortoiseCVS, which is not an advantage of SVN, although CVS has a WinCVS, but it is an additional client, it is not as convenient to TortoiseSvn. After TortoiseSVN is installed, just right click in any of the resource manager, you can appear as shown below (I played Chinese packets, so the display is Chinese, you can select any one has been installed in Settings. Language pack):
Step 1: Establish Local Repository
Suppose now starts a project, called Project1. Create a folder in the U disk (assuming to u :): u: / svn / project1. Then right click on this folder, select: TortoiseSVN | Create a file library here. There are two ways to choose, as shown below:
Berkeley Database and Local File System. The local file system is a bit similar to CVS, but the implementation is different. Berkeley database is the best embedded database solution, and TortoiseSVN selects BDB mode, recommended. Determine a slim window after being created, a prompt window will pop up, indicating that the file library is created successfully.
Step 2: Create a work folder
Create a work folder on a local hard drive (such as a D disk): D: / Working / Project1. Then right click on this folder, select: SVN is removed. Display the following dialog:
The only thing that needs to be specified is that the file library URL, local mode is to use the File protocol. After confirming, the following dialog is displayed:
After the point is determined, complete the creation work, see a hidden folder in the folder: .svn. Some of the necessary information of the work folder is recorded, the function is the same as the CVS folder of the CVS. A green hook will be made on an icon of a SVN's work folder, all the contents of the respository will add such a green hook on the icon, as shown:
Step 3: Start writing procedures
You can now create a source file or folder in this working directory. There will be some items on any file or folder (except .svn folder) in the work folder, there will be some items, and the following images are files in the work folder, the subfolders under the work folder, the files in the work folder , The right-click menu content that has been submitted: From the leftmost menu and the rightmost menu, SVN / TortoiseSVN supports almost all functions of CVS, and adds some practical features (such as file / folders. Rename, in this CVS is one of the most headache problems). This is another advantage of SVN.
If your source origin is existed, you can import it to the repository: right click on your original source folder, select TortoiseSvn | Import. I.e. However, pay attention to: It is best to set the exclusion / ignore style in TortoiseSvn | settings (you can set the folder or file name, support wildcard, case sensitive !!!), or first delete unnecessary imported files. Then remove (checkout) to the working directory.
Step 4: Submit a written program to Repository
Select all files and folders you want to join, then point TortoiseSVN | Add. The following dialog will be displayed (to submit this article as an example):
Join them to repository, determine which it will display a " " number on its icon, indicating that this file has been added, but not submitted. Right click on the current folder and select SVN submission. The following dialog will be displayed (submit this article, where the repository is what I actually used)
After successful, it will also display the green hook shown in front.
Step 5: Daily use
It is nothing more than repeating the previous addition / submission. If you are used on other machines, you need to recreate the working directory and take out the source code in the repository repository. If you are used on multiple machines at the same time, you need to use the SVN update feature to update the content in this work folder to the corresponding version in the Repository.
For more features, please refer to online help and other documentation provided by the website.
Finally, I wish you all the convenience and enjoyment of SVN.
[Mental Studio] Raptor Mar.17-05