SVN simple tutorial

Source: Internet
Author: User
Tags tortoisesvn

Are you participating in a team collaboration project?

Have you ever encountered such a situation: when you are modifying a file, another person has done the same thing. Have you ever caused your changes to be overwhelmed by this coincidence?

Have you ever wanted to restore the file to a previous one after it was saved? Have you ever thought about viewing the content of a file a few days ago?

When you find a bug in a project, do you want to know when it appears to you?CodeMedium?

If you answer "yes" to any of the above questions, tortoisesvn is what you need! You must carefully read tortoisesvn instructions and learn how to solve the above problems. This is not difficult ~

This note is intended for those who want to use subversion to manage their materials, but are not used to command line operations. Because tortoisesvn is like a Windows extended shell, users can use the software like they use my computer.

Tortoisesvn is a free software. You can use it without spending any money. Its development follows the GPL protocol.

The above is extracted from the help document of tortoisesvn. To put it simply, tortoisesvn can be considered as a code version control tool, allowing many people to write code together. Many open-source files use SVN as the source code management tool. After learning tortoisesvn, you can easily get the code.

Tortoisesvn has rich functions, but we only need to learn two simple operations. The first is to download the code, and the second is to upload. The following describes each function.

Export...

Because most open-source projects can be directly downloaded, and some permissions may need to be activated for upload, you should first download the code.

1. Download and install tortoisesvn. You will not see any executableProgramBecause tortoisesvn is embedded in windows.
2. Create an empty folder and right-click it to view the tortoisesvn menu and SVN checkout above.
3. Don't worry about this checkout. We will select export... under the tortoisesvn menu, and then it will let you enter the URL.
4. For example, enter the svn address of [maze treasure] as follows:Http://game-rts-framework.googlecode.com/svn/trunk/
5. Other options do not need to be changed. Do not select omit externals. The "head revision" option indicates the latest code version. Click "OK" to export the code to this directory :)

Just like decompression, isn't it? You can also download tortoisesvn source code from here:
Http://tortoisesvn.tigris.org/svn/tortoisesvn/
You may need to log on here. The user name is guest and the password is left blank.

Checkout...

Checkout means to check out. Although the same effect as export is to download the code from the server to the local computer, checkout has a verification function. The code from checkout to somewhere will be monitored by tortoisesvn, the files in can enjoy various SVN services.

If you select the checkout, the directory will be associated with the svn address. The changes here can be submitted to the svn server. This indicates that the Code will be written, and the permission must be activated.

You canHttp://code.google.com/hosting/Select create new project to obtain a SVN space provided by Google and upload your code. I will not detail the application process here. Just fill out a simple form.

Now, let me assume that you have obtained an SVN account and password, for example, our RTG project:
Https://game-rts-framework.googlecode.com/svn/trunk/
Note that the preceding example is https: //. If one s is added, it indicates security, which means verification is required.
Assume that the user name is guest and the password is ABC (the user name and password can be assigned to you by the Project Manager)

1. Right-click a directory and choose SVN checkout... the link is displayed. Enter the URL on which it is placed. Do not change other options, similar to export.
2. Enter the correct content when you need to enter the user name and password, and a code download screen will appear.
3. After all the files are checkout, the directory will have a green check, indicating that the Code had to be modified in the last update.

At this time, the files in the directory will have a green check. If you modify them, a red exclamation mark will appear, indicating that the file has been modified. All checked files in this directory are currently under tortoise monitoring. You can right-click the file and you will find that you can perform many operations. Next I will select some of the more common ones to explain.

Commit, revert, add, delete...

If you update files in the directory, you can use the commit function. This function uploads your local file modification records to the server, which can be understood as uploading.

But the function of commit is not just to upload files. It will be compared with files on the server. If you update a file and someone on the server updates the file, and it is an update after you checkout, then it will try to integrate your update with others' updates (merge). If the automatic merge fails, then report conflict, you must manually write your own merge, that is, to write your updates in conflict with those of others.

It is best to fill in the log information during the commit, so that others can see what your updates are written. This is equivalent to uploading files and explaining the modifications made by myself. log is very important when many people work together.

Tortoisesvn commit only uploads the file that was previously checkout and modified. If you add some new files, you need to right-click the file and select Add. A plus sign will appear on the file, the next commit will be upload and marked as a green check. Files without a green check mark will not be commit.

If you need to rename or move a file with a green check box, do not use the Windows function. Right-click them and tortoisesvn has corresponding operations. Imagine that these files are no longer your local stuff. Tortoise must be aware of every action you make.

If you modify a file but you regret it, right-click it and select revert, which will change back to the last checkut. Or revert the entire project to any previous version.

Update
If it is a multi-person project, others need to modify it if they do not modify it themselves. In this case, update is used to synchronize the code on the local server and on the server. Right-click and select update. All changes will be uploaded from the server to your hard disk. NOTE: If someone else deletes a file, you will also be deleted locally after the update.

If the local code has been modified, merge will be performed first like commit, and conflict will be reported if the Code fails.

Other ......
If some files do not want to be modified by others, you can also perform the lock operation.
You can also view the show log menu of all logs, the revision graph in the real version update graph, and the repo-browser of the server directory structure.
In addition, the tag creation operation is equivalent to copying the current code version to other places, and then starting from this place for new development, with no interference with the original version.

These are relatively advanced applications. For more information, see the help documentation http://tortoisesvn.net/docs/release/tortoisesvn_zh_cn.

 

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.