How to Use the tortoise SVN Client

Source: Internet
Author: User
Tags svn client tortoisesvn

Many of my friends like to use tortoise SVN. Tortoise SVN has a lot of things and many similar software cannot be more beautiful. Now let's take a look at the basic usage of the tortoise SVN client.

1. Export and check out
Export download Source code
Usage:
1. Create an empty folder and right-click it to view the tortoisesvn menu and SVN checkout above.
2. Don't worry about this checkout. We will select export... under the tortoisesvn menu, and then it will let you enter the URL.
3. For example, the svn address of the input [maze treasure] is: http://game-rts-framework.googlecode.com/svn/trunk/
4. Other options do not need to be changed. Do not select omit externals. The head revision option indicates the latest Code Version, and then click OK to export the code to this directory :)
Check out means to check out. Although the same effect as export is to download the code from the server to the local computer, the checkout has a verification function. The code from checkout to somewhere will be monitored by tortoisesvn, the files in can enjoy various SVN services.

2. What issues should I pay attention to each code submission?
If you update files in the directory, you need to use the commit function to submit code. The commit function is not only for uploading, but will be compared with the files on the server, if you update a file and someone on the server updates the file, and the file is updated after you checkout, then it will try to integrate your updates with others' updates (merge). If the automatic merge is not successful, then report the conflict, you must manually perform merge, that is, you can 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.
Note:
------------- If multiple files need to be submitted at the same time and the files are in different directories, you must find the files in the shortest directory and Click Commit, tortoisesvn searches the clicked directory and all the files under the directory, and lists the modified files in the list.
------------- Check the files in the list carefully to determine which files need to be updated. If you do not need to update a file that has changed, right-click the file and choose restore; select the file to be added. Do not add the temporary file to the version library.
------------- In case of a file conflict (conflict: the file to be submitted has been changed by others and submitted to the version Library), enable the conflict resolution function.
3. How to synchronize local and server versions
Use update to synchronize local and server code. Right-click SVN update, and all the changes will be uploaded to your hard disk from the server. 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. If the Code fails, conflict will be reported.
4. How to switch between the branches or trunk of the same project
Use tortoise SVN --> Switch
Enter the branch or trunk URL in the URL
5. How to compare the differences between the two versions

Local Change
If you want to see more information about your local copy, you only need to right-click the resource manager and select tortoisesvn → compare the differences.
Differences with another branch/Tag
If you want to view the trunkProgram (If you develop on a branch) You can use the right-click menu to find the modifications or modifications to a branch (if you develop on the trunk. Press the Shift key while clicking the file, and then select tortoisesvn → URL comparison. In the displayed dialog box, the URL address of the version to be compared with your local version is displayed.
You can also use the version library browser to select two directory tree comparisons, maybe two tags, or branch/Tag and the latest version. The mail menu allows you to compare them with different versions. Read section 5.9.2 "compare Folders" for more information.
Comparison with previous versions
If you want to view the differences between a specific version and local copy, select the version to be compared in the displayed log dialog box, and select compare from the context menu
Comparison of two previous versions
If you want to view the differences between any submitted two historical versions, select the two versions you want to compare in the version log dialog box (generally press Ctrl-change ), then, right-click the menu and select compare version differences.
If you do this in the version log of the folder, a compare version dialog box is displayed, showing the file modification list of the folder. Read section 5.9.2 "compare Folders" for more information.
Submit all modifications
If you want to view all changes to a version in a window, you can use the GNU snippets to display all the comparisons in a unified manner ). It displays part of all modifications. It is difficult to show a clear comparison, but all the changes will be displayed in a centralized manner. In the "version log" dialog box, select a version and choose "show all comparisons" from the context menu.
File differences
If you want to view the differences between two different files, you can directly select these two files in the Resource Manager (usually Ctrl-modifier), and right-click tortoisesvn in the menu → compare the differences.
Comparison between WC files/folders and URLs
If you want to view the differences between any file in your local copy and any file in the version library,
Comparison between condemned messages
If you want to view not only the differences but also the author, version number, and date of the modified version, you can compare the differences and condemnation information in the version log dialog box. For more information, see section 5.20.2 "difference tracing ".
Compare folder differences
The built-in tool of tortoisesvn does not support viewing the differences between multi-level directories, but you can use an external tool that supports this function. Here, section 5.9.4 "Other comparison/merge Tools" describes some of the tools we have used.
6. How do I know what files I have modified and what files others have modified when submitting code?
7. How to know who modified a certain row of a file

8. How to Create a branch or tag for an SVN master project
To create a branch, follow these steps:
1. Select the file where you want to generate the branch, right-click it, and select [branch/mark...]
2. In the [to URL (t)] input box, rename the file as your branch file name, enter the log information to facilitate differentiation, and click "OK.
3. A file you specified will be copied in the svn repository. The file name is what you named, but the new branch file name cannot be found in your local directory, to update your file to your branch, You must select a file, right-click it, and select [switch...]. select the file you want to rename and click OK. In this way, your local file is associated with the Branch file. Don't be surprised, the file name displayed on the local directory is still the old file name.
Experience summary:
1. If the file to be operated has not been submitted before, and you want to submit the file to the new branch, remember to switch.
2. SVN branch management is actually to save different branches with different files. Therefore, when you obtain the new version, you will find that the latest files of different branches will also be obtained.
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.
For the three directories branches, tags, and trunk, it is not necessary for the subversion, but a good habit of Team Development summarized. The usage is as follows:
1. The developer submits all new features to the backbone. Daily modifications are submitted to/trunk: New features, bug fixes, and others.
2. The trunk is copied to the "publish" branch. When the team determines that the software is ready for release (for example, version 1.0),/trunk will be copied to/branches/1.0.
3. The project team continues to work in parallel. One team starts to perform rigorous tests on the branches, and the other team continues the new work at/trunk (for example, prepare 2.0 ), if a bug is found at any location, the bug fix needs to be shipped back and forth. However, this process sometimes ends. For example, the Branch is already "stuck" for the final test before release.
4. The Branch has been tagged and released. when the test is completed,/branches/1.0 as a reference snapshot has been copied to/tags/1.0.0. This tag is packaged and released to the customer.
5. Multiple branch maintenance. When version 2.0 continues to work on/trunk, bug fixes continue to be shipped from/trunk to/branches/1.0. If sufficient bug fixes are accumulated, the management department decides to release version 1.0.1: copy/branches/1.0 to/tags/1.0.1, And the tag is packaged and published.
Generally, when the initial repository is created, these three directories are created and all the code is put into/trunk. For example, to import the code under the project1 Directory into the repository, the structure of project1 is: project1/branches, project1/tags, project1/trunk, project1/trunk/food. c, project1/trunk/egg. PC ......, Import the project1 directory to repository to create the initial database. Then, the export is returned to project1 as the local working directory.

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.