SVN usage Tips

Source: Internet
Author: User
Tags svn client svn update tortoisesvn

The CVS full name is concurrent version System, so here's the concept of version, which exists locally and on the server , when you commit a file to the server, The server will first check the version and server version you want to commit, and if there are two no conflicts then the update succeeds and if there is a conflict, the error. Similarly, for the update operation, the server is only updated to be lower than its own version, so you modify the subsequent local files will not be updated.

1. If you move something on SVN (or CVS) and do not commit to the server, then if you use the update operation, you will not update the contents of SVN to your local, that is, what you see on your machine is what you changed after.
2. Before the commit operation, it is best to update the first, because it is possible that someone else put the new version on the server, and you did not update to your local, at this time if you do not do update operation, and directly commit, will be an error.
3. If you want to give up your changes, directly using the server page, you must first restore your changes, and then update from the server on the OK.

Master principle
1, Team-synchronize
2, Incoming Mode all update
3, outgoing Mode all commit
4. Confilcts Mode Conflict Resolution, save, Compare, Override and Update, modify, Commit

If you update your code from the repository, it is recommended that you open the SVN console window to see the SVN update log, which typically shows the following code identifiers, as shown in C:

Where: A represents the added, representing the added file. D means Delete, which represents the deleted file. The u represents the updated file that represents the update. c is for merging, and there are conflicting files in the merge, which can cause code error and so on . g represents a merge, and no conflicting files are in the merge. the presence of C in the console indicates that some code in the local file that you modified is conflicting with the code in the file that someone else modified and updated to the SVN.

Why does SVN automatically generate r.java.mine,r.java.r3368,r.java.r3439?
This is because of a conflict, You and others from 3368 This version of the R.java this file has been modified, others modified the first submitted to form the 3439 version, and then you do the commit operation, in order to avoid overwriting someone else's modification work, SVN prompts you to conflict, and automatically form R.java.mine, r.java.r3368, r.java.r3439 these three files.
which
R.java.mine is the version you are prepared to submit after you make your own changes;
r.java.r3368 is your initial version;
r.java.r3439 is the version that someone else has submitted before you;

There should also be a R.java is automatically merged with your version and others submitted by the version of the formation (where the <<<<<, ======, >>>>> and other symbols marked with the auto-merged parts).
The purpose of automatically generating these files is to allow you to manually merge the changes of your two people. It is recommended that you look at the history of this file, see 3439 who submitted the version, ask him where he has changed, and then you manually merge the changes of your two people into the same file R.java, and then use SVN to mark "conflict resolved", The extra files will be deleted automatically after tagging, and you will be able to submit them normally.
One. Download the SVN server-side installation, configuration 1. SVN is the most popular and state-of-the-art version control work in software development at present, which has many advantages over VSS, CVS and other version control tools. 2.SVN divided into server side and client

Server-side refers to Tigris svn; The client includes the Tortoise Svn,eclipse svn plugin, which is also the most common

3.SVN Related software:

Server side: http://www.tigris.org/

Client Tortoise Svn:http://tortoisesvn.net/downloads.html

Eclipse SVN plugin: http://subclipse.tigris.org/

4.SVN server-side deployment steps:

1. Download installation, fool-type installation, very simple

2. After the installation is complete, create the resource library (Repository) and store all the project resources in the future, with the following command (cmd execution)

Svnadmin Create D:\SVNREPO\REPO1

REPO1 is created as a resource library

3. After the repository has been created, locate the D:\SVNRepo\Repo1\conf\svnserve.conf file to open, modify

Before the modification:

[General]

# # # These options control access to the repository for unauthenticated

# # # and Authenticated users. Valid values are "write", "read",

# # # and "None". The sample settings below is the defaults.

# anon-access = Read

# auth-access = Write

# # # The PASSWORD-DB option controls the location of the password

# # # Uncomment the line below to use the default password file.

# password-db = passwd

# # # The AUTHZ-DB option controls the location of the authorization

After the modification:

[General]

# # # These options control access to the repository for unauthenticated

# # # and Authenticated users. Valid values are "write", "read",

# # # and "None". The sample settings below is the defaults.

Anon-access = Read

auth-access = Write

# # # The PASSWORD-DB option controls the location of the password

# # # Uncomment the line below to use the default password file.

Password-db = passwd

# # # The AUTHZ-DB option controls the location of the authorization

Note: anon-access = read

auth-access = Write

Password-db = passwd, no spaces in front of each line

4. Create user, configure access rights

Find D:\SVNRepo\Repo1\conf\passwd, add user and password, after completion, the user can submit the project to the repository, add user zs, password ZS

[Users]

# Harry = Harryssecret

# sally = Sallyssecret

ZS = Zs

5. Start the SVN server

Svnserve-d-R D:\SVNREPO\REPO1

Two. Enter the SVN client plug-in in MyEclipse, divided into Automatic Updates and

Note: The SVN client has many, most commonly used MyEclipse client plug-ins and svntortoise clients

MYECLIPSE_SVN Client Plug-in: http://subclipse.tigris.org/

Svntortoise Address: http://tortoisesvn.tigris.org/

1. Automatic Updates, which are directly connected to the extranet via Eclipse, are referenced in the following steps: Http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA

2. Manually update, manually download the Eclipse SVN plugin package, and copy the extracted content directly to the corresponding directory in eclipse

3. Opening eclipse, you can see the SVN repository as follows, stating that the SVN client plug-in has been successfully installed:

Three. Create a project four. Share the project to the SVN repository server

Right-click Project-->team-->share project--> Repository location: SVN://IP address, Share project simply establishes a directory correspondence between the local project and the SVN repository. The project is not actually submitted to the SVN repository, and then the project is submitted to the repository

Five. Submit the project to the SVN repository server

The right mouse button project-->team--> commits, at this point the new project is actually submitted to the repository, so that other developers, the client can be taken from the repository to submit the project

Alternatively: You can also use TORTOISESVN to submit the project to the repository.

Six. When the client is developing, "Check out the project from the SVN server as"

The first time a developer takes a project from the repository,

(1) To establish a repository location

(2), right-click on the resource pool and check out the

Seven. To modify the code, be sure to update it, take the latest document from the repository, and then modify

Most commonly used:

Update: Take the latest project from the repository

Commit: After modification, commit the modified content to the repository

Sychronize: Synchronize the local project with the resource pool to see what the local project differs from the repository, and when it comes to code modification conflicts, you can use the

Eight. After the modification is complete, submit

Note: When two people modify a file at the same time, must be a modification to complete, after submission, the other to take the latest version of the changes, so that the need for human communication, version control tools, and not replace all human communication

SVN usage Tips

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.