Common Operations of tortoise SVN version control

Source: Internet
Author: User
Tags svn update tortoisesvn

Today, the boss ran to ask me how to roll back the current version of the svn server to a certain version. I did not answer the question and it was a failure. So now I want to sort out the operation knowledge of tortoise SVN, of course, all content comes from the Internet, so there is not much nonsense:

Tortoisesvn User Guide (http://www.svn8.com/shouce/tortoisesvn1.5.8)

 

0: What is the SVN version number??

SVN commitThe operation can be used as an atomic transaction to publish any number of files and directory modifications. In your work copy, you can change the file content, create, delete, rename, and copy the file and directory, and then submit the file as a whole.

In the version library, each commit is treated as an atomic transaction operation: either all changes occur or none, subversion strives to maintain Atomicity in response to program errors, system errors, network problems, and other user behavior. Each time a version library accepts a commit, the file system enters a new state called a version. Each version is assigned a unique natural number, which is bigger than one. The initial revision number is 0, only one empty directory is created, with no content.

You can regard the version library as a series of trees. Imagine a group of version numbers starting from 0, from left to right. Each revision number has a directory tree hanging under it, each tree seems to be a "snapshot" of the submitted version library ".

Unlike other version control systems, the version number of subversion is for the entireDirectory treeAndNot a single file. Each version number indicates the specific status of the entire directory tree of the version library after the submission. Another understanding is that version n indicates that the version library has been submitted n times. When the Subversion user discusses"foo.cIn version 5, they actually mean "in version 5foo.c". Note that the versions of a file are N and M andNoIt must be different.

Note that Working Copies do not necessarily correspond to a single version in the version library. They may contain files of multiple versions. For example, you can check a working copy from the version library. The latest version is 4:

calc/Makefile:4     integer.c:4     button.c:4

At this moment, the working directory exactly corresponds to version 4 of the version library. However, you have modifiedbutton.cAfter the submission, if there is no other submission, your submission will create version 5 in the version library, and your work copy will look like this:

calc/Makefile:4     integer.c:4     button.c:5

Assume that Sally has submittedinteger.cTo create Revision 6. If you useSVN updateTo update your work copy, you will see:

calc/Makefile:6     integer.c:6     button.c:6

Sally pairinteger.cThe changes will appear in your work copy.button.cIs changing. In this example,MakefileVersions 4, 5, and 6 are the same, but the SubversionMakefileIf the version is set to 6, it indicates that it is the latest version. Therefore, if you perform a clean update in the top-level directory of the working copy, it will make all the content correspond to the same revision of the version library.

 

1: How to check the latest version number of the current code library on SVN?

Right-click show log in the menu, and then you can see a series of version update history. The last line is the latest version number, the so-called head revision.

 

2: How to check the current version number of the code library managed by local SVN?

Right-click show log in the menu, and you will see a series of version update history. The line shown in bold is your local version.

 

3: how to roll back the version of the local code library to an old version?

Right-click Update to revision in the context menu. In the displayed dialog box, specify the version number. If you select head revision, update it to the latest version.

 

4: How can I roll back the server version to an old version?

I have not found any good method to roll back the version on the server to an old version. The stupid way is to first upgrade the old version to a local version, and then directly commit the version, you must first put all. delete all SVN files, overwrite the local version, and then perform commit.

 

5: What is the difference between the export and check out of tortoisesvn?

Create an empty folder, right-click it, and you will see the tortoisesvn menu and the svn checkout above.
You don't need to worry about this checkout. We choose export... under the tortoisesvn menu, and then it will let you enter the URL.
, For example, enter the svn address of [maze treasure] is: http://game-rts-framework.googlecode.com/svn/trunk/
Other options do not need to be changed, do not select omit externals, head revision is selected to indicate the latest code version, and then click OK to export the code to this directory.
Check out means to check out the code. Although it works the same as export, it downloads the code from the server to the local, but checkout has the verification function, and the code from checkout to somewhere, it will be monitored by tortoisesvn, and files in it can enjoy various SVN services.

 

6: What should I pay attention to every time I use the commit code?
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.

 

7: What do the local green icons mean?

A new detected work copy is reloaded with a green check mark. Indicates that the Subversion status is normal.

After you start editing a file, the status changesModifiedThe icon reload turns into a red exclamation point. In this way, you can easily see which files have been modified since you last updated the work copy and need to be submitted.

IfConflictThe icon will become a yellow exclamation point.


If you setsvn:needs-lockAttribute, subversion will make this file read-only until you get the file lock. Files with this overload icon indicate that you must get the lock before editing.

If you have a file lock and the subversion status isNormalThis overload icon reminds you to release the lock if you do not use the file and allow others to submit modifications to the file.

This icon indicates that some files or folders in the current folder have been scheduled from version control.DeleteOr a version-controlled file in the folder is lost.

The plus sign indicates that a file or directory has been scheduled to be added to version control. But you still need to commit it.

This icon shows files and folders which are not under version control, but have not been ignored. This overlay is optional.

This flag indicates that the file or folder is not under version control.


8: What is the check depth of SVN check-out code?

You can selectDepthIt allows you to specify the recursive depth of sub-directories. If you only need several sub-entries in a large directory, you can check out only the top-level directories and recursively update the selected directories.

Full Recursion

Check out the complete directory tree, which contains all files or subdirectories.

Direct node, including directory.

Check Directory, which contains files or subdirectories, but does not recursively expand subdirectories.

File sub-power saving

Check out the specified directory, which contains all files, but does not check out any subdirectories.

Only.

Only check the directory. Does not contain files or subdirectories.

Working copy

Maintain the depth specified by the working copy. This option is not used for the check-out dialog box, but is the default configuration for all other dialog boxes with deep configuration.


9: What is clean up?

Maybe a subversion command cannot be completed successfully due to a server problem, and your work copy is stuck in an inconsistent state. In this case, you need to use the tortoisesvn → cleanup command on this directory. It is a good idea to use it in the root directory of the working copy.

Another use of clean up is that if the date of a file has changed but its content has not changed, SVN cannot know whether it has changed, unless it is compared with the old document by byte. If you have many files in this status, the update operation will be slow and the system response will be affected. At this time, running a clean up operation can make the status of those files become normal, and the future check speed will be improved.


A good habit: If the project references other third-party assemblies, such as enterpriselibrary and FCKeditor, do not reference them from their installation location, but in your solution, add a library directory, copy the required assembly to this directory, and then reference it from the library directory. What are the advantages of this? Think about it for yourself!

 

 

 

 

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.