Source Code Control Tool SVN

Source: Internet
Author: User
Tags svn client svn update

Source Control Tool SVN is a very powerful source control tool, now domestic 70%-90% companies are using SVN to manage the source code, let's give you a small part to focus on the use of SVN, SVN's use is mainly divided into the following blocks.
    • SVN's usage environment
    • Server-side configuration
    • Use of client software
    • The use of client-side graphical interface tools
    • SVN's directory specification and usage examples
1.SVN usage environment.

To use SVN to manage your source code, you have to have two sets of environments

    • Server-side
    1. can be used to store the source code for client uploads
    2. You can install Visual SVN Server on Windows
    3. In most cases, the company's developers do not have to build the SVN server, basically you enter the company after the company will have the SVN server address and your user name and password to tell you, of course, if he is not at ease with you, he may visit you for a few days before deciding whether to give you.
    • Client
    1. Upload local source code to the server, or update the server to local, keep synchronization
    2. You can use the command line, Versions, cornerstone-graphical operating software on your Mac, Xcode
    3. The developer belongs to the client, the role
2. Server-side configuration

Server side installs Visual SVN server-http://www.visualsvn.com/server/download/on window pc

    • Install Visual SVN Server
    • Create a code Warehouse
    1. Click on the first yellow folder on the left, then click New, enter a name, next, so that an empty warehouse is created.
    • Add user
    1. Click the second yellow folder on the left, right-click, create a new user, and set the user name and password. Click OK to submit when you are finished setting up.
    • Set permissions
    1. Click on the repository you created, right-click, and select the Properties option.
    2. Click on properties to come up with an interface, select the user you just created, then click Add.
    • Access the warehouse address.
    1. Select the repository you created, then right-click on the copy URL and click on it to get the repository URL in our clipboard.
    2. Open your computer's browser, enter the URL you just received, and then you need to enter a user name and password, you can enter the warehouse after entering.
Configuration of the 3.SVN client
    • Enter in the terminal

SVN checkout https://192.168.1.106/svn/Weibo//users/documents/workspace

HTTPS://192.168.1.106 represents: The remote address of the code warehouse-this is the IP address of the computer you just

/svn/weibo//users/documents/workspace stands for: which path to download the code to local

    • SVN client command
    1. SVN info: View the details of a file
    2. SVN diff: See the difference between different versions
    3. SVN log: View log information
    4. SVN list: List of files and directories under repository
    5. SVN Status: View file status (abbreviated SVN ST)
    6. SVN help: Get assistance information (e.g., SVN assist CI)
    7. SVN Lock: Add lock
    8. SVN unlock: Unlocking
    • Submit
    1. SVN commit-m "Notes" [PATH]
    • Add to
    1. Submitting a new file to the server requires 2 steps
    2. Add the newly created file to the local version control repository: SVN add
    3. Submit the Add action to server: SVN commit
    4. If you submit a file that is not added to the local version control library, the following error is reported in Lis not a working copy
    • Delete
    1. To delete a file on a server, you need to do 2 steps
    2. Remove files from the local version Control library: SVN Delete, svn remove
    3. Commit the delete operation to the server: SVN commit
    4. Remove the SVN delete PATH from the local version control library
    • Update
    1. Update the server's latest code to the local SVN update [PATH] Sample

      SVN update [File path to update]

      n Restore the file to a version of SVN update-r version number [PATH]
4. Graphical interface Tools
    • On Mac, you can also use the SVN graphical interface tool to manage your source code, which can greatly reduce the pain of using the command line (some operations are cumbersome with command lines, such as conflict resolution) Cornerstone/versions/xcode most of the work in Xcode can be done
    • Xcode support for SVN is not very friendly, especially when creating a new folder that is prone to problems in Xcode
    • Work with Xcode: Update first, then submit!
    • Xcode, it's best not to modify a storyboard! at the same time.
    • Download Cornerstone Add Management warehouse in Mac
5. Catalog Specification
    • The SVN directory structure of a regular project typically has 3 folders
    • Trunk: Trunk, home directory of the current development project
    • Branches: Branch directory, which is used when non-mainline features are added, can be merged into a skeleton project after development testing
    • Tags: tags directory, usually as a major version of the backup
6. Summary of Frequently Asked questions
    • Go to the company's first day, download the company's code to the computer on SVN checkout
    • Modified an old file that already existed and then submitted it to the server SVN commit
    • Submit a new file of your own to the server
    • SVN addàsvn Commit
    • Delete an old file that already exists, and then sync to the server SVN deleteàsvn commit
    • Update new code submitted by other colleagues to your computer SVN update
    • Accidentally write a lot of things wrong, want to undo the written things (have not yet submitted the changes to the server) SVN revert
    • Accidentally deleted the wrong file, want to restore the file back (not yet deleted to the server) SVN revert
    • Accidentally write a lot of things wrong, want to undo the written things (have changed to submit to the server) SVN update-r version number
    • Accidentally deleted the wrong file, want to restore the file back (has deleted to submit to the server) SVN update-r version number
    • SVN this hidden directory records very critical information never manually modify or delete this. svn hidden directory and files inside! Doing so will cause the local working copy to be corrupted and cannot be manipulated.
7. Using SVN we should
    1. Frequent updates: reducing the likelihood of conflict
    2. Before committing to a native test pass: Reduce the issue code to the repository
    3. Be sure to write notes when you submit (note): Convenient for other employees to view and review them later
    4. Do not submit to the repository for files that do not need to be submitted
    5. It is best to update it before each modification
    6. Code that runs through the day before work day
    7. The first thing that goes to work every day updates the code

Source Code Control Tool SVN

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.