Team Development uses SVN for Version Control (with the combination of Dreamweaver and Svn in Web Development)

Source: Internet
Author: User
Tags svn client svn update
This is a little introduction to SVN, and I will write it down for backup.

First, set up the svn Server
A team can set up a server. If you do not need to set up a server, you can skip this step.

1. download and install the server and client.
Note that the subversion and SVN versions on the server must be consistent. Otherwise, the file system may be inconsistent.
The following are my summary notes. For specific configuration methods, refer to this tutorial:
Http://chengyue2007.iteye.com/blog/574867
2. Create a place to store the version Library
Create an empty folder and use SVN to create a version library.
3. Configure and enable the svn Service
After creation, you must configure the user and specify the user name and password.
Enable the service. We recommend that you use it as a service in windows and run it in the background.
As a service, the method is as follows:
Open CMD and enter the following command:

sc create SVNService binpath= "C:\Program Files\Subversion\bin\svnserve.exe --service -r E:\SVN\jmr" displayname= "SVNService" depend= Tcpip start= auto

SVN will be able to run automatically after the system is started.
4. Import the code to the version library.
You can use the user you set to import the data. In fact, this is a client behavior, so you need to enter the svn server address and user name and password.
In this way, the svn server is set up. Now you can let team members use your SVN.

If web development uses SVN for version control, there are several solutions.
First, the code in the SVN version library cannot be used for Web testing. Therefore, SVN is only used for version control.
1st Methods: all members can use their own machines as test servers, compile their own functions, and upload files to the svn server after the test is successful on their computer. Other members can download the latest version from SVN.
Method 2: You can perform a test on only one web server. Every time SVN has a file update, the root directory of the web is updated accordingly. A script file can be used for implementation. See the following URL:

3rd Methods: you can combine the first two methods or FTP and SVN. These methods are not specific, but the first two methods are quite good.

Second:
Team members only need to use the svn client.
1. Use toturialsvn for general software development. If you use Dreamweaver to develop Web applications, skip this article and refer to the following Dreamweaver usage method.

2. Use Svn in Dreamweaver

For more information, visit: http://help.adobe.com/zh_CN/Dreamweaver/10.0_Using/WS80FE60AC-15F8-45a2-842E-52D29F540FED.html
This requires Dreamweaver cs4 and later versions to support Version Control of SVN. The method for building a website is as follows:

I would like to explain how to build a website here. However, it is very common to create a website, and there are a lot of online tutorials, so I will not bother. Here I will only write the svn connection establishment method here.

To establish a SVN connection, follow these steps:

1.
Select "Site"> "manage site", select the site for which you want to set version control, and click "edit.

Note:If you have not set local and remote folders for the Dreamweaver site, you must at least set the local site before continuing. (Remote sites are not required at this stage, but files are eventually published
Before the Web, you still need to set it .) For more information, see settings
Dreamweaver site.

2.
Be sure to select the "advanced" tab in the "site definition" dialog box.

3.
In the "category" column of the "site definition" dialog box, select the "version control" category.

4.
Select "Subversion" from the "access" pop-up menu ".

5.
To set access options, follow these steps:

§ Select a protocol from the "protocol" pop-up menu. Optional Protocols include
HTTP, https, SVN, SVN + SSH.

Note:The SVN + SSH protocol requires special configuration. For more information, visit www.adobe.com/go/learn_dw_svn_ssh_cn.

§ In the "server address" text box, enter
The address of the svn server. The common format is: server name. domain. com.

§ In the "repository path" text box, enter
Path of the repository on the svn server. It is usually similar to/SVN/your_root_directory. The name of the root folder of the svn repository is determined by the server administrator.

§ (Optional) if the server port you want to use is different from the default server port, select "non-default" and enter the port number in the text box.

Enter the username and password of the svn server.

6.
Click test to test the connection, or click OK to close the dialog box. Click "finish" to close the "manage site" dialog box.

 

Third: SVN usage methods and specifications

From: http://www.cnblogs.com/xpxu/archive/2010/04/06/1705195.html

Update first, and then submit
The SVN update principle is to be updated at any time and submitted at any time. When a small feature is completed, it can be compiled and tested by itself, and then submitted with caution.
If someone else changes the svn file during the modification, the commit may fail. If the same file is changed by others, the file is automatically merged during update. If the modified row is the same, a conflict occurs during the merge, in this case, you need to contact the previous developers and negotiate with them to resolve the conflict. After the conflict is resolved, You need to test together to ensure that the program will not affect other functions after the conflict is resolved.
Pay attention to the list of updated files during the update process. If an update is generated during the submission process, you also need to re-compile and complete some necessary tests before submitting. In this way, you can understand which files have been modified by others, and avoid code errors caused by SVN merge errors.

Multi-submit
The interval of each submission is as short as possible. It is best to work on development within several hours. For example, when you change the UI, you can submit the UI once every time you modify or design the UI. When developing a function module, you can submit each time you test a small-Detail function. When modifying a bug, you can modify a bug and confirm that the bug has been modified, it will be submitted once. We advocate multiple submissions, so we can add insurance for code.

Do not submit code that cannot be compiled
Before submitting the code, make sure that you can compile it locally. If a third-party class library is used in the code, consider that some members of the project team may not have installed the corresponding third-party class library. When preparing the project work area, the project manager must consider this situation to ensure that the development team members can compile the code in a unified environment after checking out the code.

Clear annotations must be written for each submission.
When SVN is used in a project team, if empty or inaccurate annotations are submitted, other members of the project team may feel helpless and the Project Manager cannot clearly grasp the work progress, the summary of this submission cannot be clearly grasped. After an error is found, you cannot accurately locate the file that causes the error. Therefore, when submitting a job, you must enter a clear description to briefly describe the information of the submitted file, let other members of the project team understand your modifications without looking at the code in detail after seeing the annotations.

Do not submit files automatically generated locally.
For example, the. classpath file in eclipse, the thumbnail thumbs. DB generated by windows, the temporary file. OBJ and. Class generated by project compilation, and so on. If this configuration is not configured in the project to forcibly prohibit the submission of such files, do not submit such files. After submitting such a file, someone else may conflict with the local environment after the update, thus affecting everyone's work.

Do not submit code that you do not understand
After the code is submitted to SVN, your code will be shared by the project members. If you submit code that you do not understand, you cannot understand it, and others cannot understand it. If you encounter problems in the future, it will become a risk of project quality. Therefore, before introducing any third-party code, make sure you have a clear understanding of this Code.

Use the lock function with caution
Use the locked feature with caution in the project. After you lock a file, others cannot modify and submit the file. Although this can reduce the incidence of conflict, however, it may affect the work of other personnel in the project team. Locking is applicable only when you edit files that cannot be merged (such as instance files and Flash files.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.