Version Management-SVN local version management

Source: Internet
Author: User
Tags svn update tortoisesvn

0. Introduction

The use of tools is the basic difference between humans and animals, the use of tools can greatly improve efficiency, reduce the error rate. In the field of PC software, there are many useful tools that are important infrastructure for software engineering. However, embedded development, in the number of its code, many times due to the lack of those endless frameworks and libraries, so the code is much smaller than the size of the operation of the embedded carrier determines the impossibility of running large-scale programs, the target files are generally KB units, real-time with the operating system embedded development, The target code is also often the MB level.

These factors cause many embedded developers to the code tool is not very important, direct manual management of code, habitual changes to copy a version, a few days down, if the file is in the date unit, a daily version or a day there are several suffix version, but not all the way v1,v2,v3 suffix backup ... A period of time back down, these things can only be understood by themselves, but once put aside a few days, one day and back to the question of which problem, because there is no change in records and other reasons, and become difficult, I also can not understand. Although the company has a server, but involving the development of multiple people, server submissions are very cautious, usually to make a phased result or a module test before the server merge. Most of the time is local development, a week to the server commit one or two times. Eventually led to the rapid consumption of the local hard disk, the code is still difficult to recall a node, especially for some verification and try to work the new version, these attempts are actually very valuable, but eventually overwhelmed by a large number of backup files, when the hard disk burst is often all the backup all deleted, the project rushed to the urgency, There is no sense in taking care of meaningful research and backup.

In fact, these can be used in this machine version management software is a good solution, this article on the version of the single version of management. PC software can be bypassed, the server warehouse is not restricted by the location, the machine failure probability is basically zero, stronger than the single-machine, do embedded friends, or do not deep in the students and enthusiasts can see this article, after all, experience.

1.SVN Local version Management

1.1 Download Install Tortoise SVN

Standalone version management, Tortoise SVN is enough, if the multi-person cooperation project, of course, the direct use of visual svn, mainly the configuration of visual svn Server, is a fool-like installation, no longer repeat. (This article discusses only the Windows platform)

1.2 Code Management Basics Operations

A New Code Warehouse

1, new folders, directories and folder names preferably in English;

2. Open the folder and press the right button in the blank space;

3. In the pop-up menu, select "Tortoise svn-create repository Here";

4, Pop-up dialog box, prompt to create a successful, and automatically create a directory structure in the folder;

5, in the Resource folder, right-click "Tortoise Svn–repo Browser", and then copy the Code warehouse address URL, is actually the local folder address added file://.

B Import project (add project to code base)

1. Open the existing project folder and press the right mouse button in the blank space;

2. Select "Tortoisesvn-import" in the popup menu.

3, select the Import path file:///F:/repository, fill in the Notes information, click "OK" to start the import;

4. After the import is complete, you will be prompted to view the imported files and click "OK" to complete the import.

C Set up working directory (check out)

1, the new Working Directory folder, in the blank place to press the right mouse button;

2. In the popup menu, select "SVN Checkout ...";

3, in the Pop-up dialog box select the Library directory, working directory, click "OK" to start checking out;

4. Pop up the Details dialog box, click "OK" when the export is complete.

You can see more files in the version Management library in the working directory, which are versioned, changes to these files can be saved to the library, or the old version of the file can be recovered from the library.

In general, you can also right-click anywhere, select "SVN Checkout ..." In the popup menu, and then modify the saved path of the checked-out file.

D Update working directory

1. For stand-alone versioning, this problem can be largely ignored unless you have a check out in several places and then commit the changes. Then one day you go to work in your usual directory and commit the changes, but the version you're using is not up to date.

2. Updating files before work is a good habit, usually before you make changes to the working directory, in order to ensure that your files are up-to-date and need to be updated;

3. In the working directory, click the right mouse button, select "SVN Update";

4. A popup dialog will start to update and show what is updated and how much the library version is. Here I submit a version in another directory, then to the workspace directory, and then submit an update.

E. Submit working directory (commit, check in)

1, the local directory has been modified, and then need to submit to the code base;

2. Click the right mouse button in the blank space or directory in the working directory and select "SVN Commit";

3, will pop up the dialog box, you can enter the notes information, convenient to view the history.

Show which files will be submitted, what type of changes, click "OK" to start the submission, for example, I added a folder inside the Add2.txt file, and then submit the display add type changes;

4. The popup dialog shows the progress of the submission, click "OK" when finished.

If it is not a new file, but instead modifies the existing file and submits it, the file modification is displayed.

F. Version rollback

The question has come, the first to be cited, how to return a version.

1. For a more clear test. Let's submit it once and make a note. The log at the time of submission is written as: Test version rollback v7.

2. Modify the file, submit the second time, log is test changed 1.

3. Modify the file and submit it for the third time.

4. The version is rolled back to V7.

Currently version 9, you can go back to version 7. Roll back based on version.

Of course, the average is rolled back according to the comment at the time of submission. Find a version, and then right-select Update item to revision or direct check out, the effect is the same.

G. How to add a new file

As below, two new files have been created.

Then add the new file to the code warehouse and tell SVN that the two younger brothers are also helping to guard it.

Right-click the "Tortoisesvn-add" dialog box to select the file you want to add. If you right-click on the file, the two files are added directly to the repository without prompting.

After the addition succeeds, the red hint indicates that it is inconsistent with the repository and is not synchronized. After submission, the red exclamation mark will turn into a green hook.

After submission, these two files have a backup in the code repository, and there will be two files at the next check out.

Similarly, to delete a file also must commit, let SVN know no longer need to manage this file, the next time check out he will not appear this file.

However, if you follow the version, you can still find the deleted file in the current version, which is the advantage of the version management software.

To cancel the file you just added, just revert it, and add the logic exactly the opposite.

Version Management-SVN local version management

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.