YouTip LogoYouTip

Svn Intro

* * * Subversion (SVN) is an open source version control system, in other words, Subversion manages data that changes over time. This data is placed in a central repository. This repository is much like an ordinary file server, but it remembers every file change. This way you can restore files to old versions, or browse the file's change history. * * * ### SVN Concepts * **repository (source code repository):** The place where source code is stored uniformly * **Checkout:** When you don't have the source code on your hand, you need to checkout a copy from the repository * **Commit:** When you have modified the code, you need to commit it to the repository * **Update:** When you have checked out a copy of the source code, updating will synchronize your source code with the repository, so your local code will have the latest changes The daily development process is actually like this (assuming you have already checked out and have been working for several days): Update (get the latest code) --> Make your own modifications and debug successfully --> Commit (everyone can see your modifications now). What if two programmers modify the same file at the same time? SVN can merge the changes from these two programmers. Actually, SVN manages source code at the line level, meaning as long as two programmers didn't modify the same line of code, SVN will automatically merge both modifications. If it's the same line, SVN will prompt a file Conflict, which requires manual confirmation. ### SVN Main Features * (1) Directory Version Control CVS can only track the history of individual files, but Subversion implements a "virtual" version-controlled filesystem that can track changes to entire directories over time. Both directories and files can be version controlled. * (2) True Version History Since CVS limits file version records, CVS does not support operations that may occur on files but affect directory content, such as copying and renaming. Additionally, in CVS you cannot replace a file that has already been incorporated into the system with a file of the same name but without inheriting old version history or having any relationship. In Subversion, you can add, delete, copy, and rename, whether files or directories. All newly added files start from a new, clean version. * (3) Atomic Commit A commit operation is either completely updated to the repository or not updated at all. This allows developers to build and commit changes in logical units, to prevent problems when partial commits succeed. * (4) Metadata Under Version Control Each file and directory is attached with a set of property keys and associated property values. You can create and store any Key/Value pairs you want. Properties are version controlled over time, just like file contents. * (5) Different Network Layers Subversion has an abstract repository access concept, which makes it easy to implement new network mechanisms. Subversion can be embedded as an extension module into the Apache HTTP server. This provides Subversion with very advanced stability and collaboration capabilities, in addition to providing many important features: for example, authentication, authorization, online compression, and repository browsing, among others. There is also a lightweight standalone Subversion server that uses a custom communication protocol and can be easily used through ssh as a tunnel. * (6) Consistent Data Handling Subversion uses binary diff algorithms to represent file differences, treating both text (human-readable) and binary (human-unreadable) files equally. Both types of files are stored in the repository in compressed form, and file differences are transmitted over the network in both directions. * (7) Efficient Branching and Tagging The cost of branching and tagging does not necessarily have to be proportional to the project size. Subversion's method for creating branches and tags is simply to copy the project, using a method similar to hard links. So these operations only cost very little, and the time is fixed. * (8) Hackability Subversion has no historical baggage; it is mainly a group of shared C libraries with well-defined APIs. This makes Subversion easy to maintain and can be used by other applications and programming languages. ### Advantages Over CVS * 1. **Atomic Commit:** A single commit, whether for one or multiple files, is submitted as a whole, so either all commits succeed or none do. This prevents database incompleteness and data corruption. * 2. Actions such as renaming, copying, and deleting files are all preserved in the version history. * 3. For binary files, a space-saving storage method is used. (Simply understood as only saving the differences from the previous version) * 4. Directories also have version history. The entire directory tree can be moved or copied, the operation is simple, and all version records can be preserved. * 5. The cost of branching is very small. * 6. Optimized database access makes some operations possible without accessing the database. This reduces a lot of unnecessary network traffic between the database host and the client.
← Svn Start ModeProp Script Charset β†’