Problem:
- Installation optimization Software Environment Nginx,lvs
- program code (constantly updated)
- Configuration updates (constantly changing)
1. SVN Introduction 1.1 What is SVN (Subversion)?
SVN (Subversion) is a very good version management tool that has risen in recent years and, like the CVS management tool, SVN is a cross-platform, open source version control system. The SVN version management tool manages various data changes over time. This data is placed in a central repository (repository), which is much like an ordinary file server or FTP server. Unlike other servers, SVN backs up the changes that are recorded every time each file is modified. This allows us to revert to an older version of the desired file at any point in time, or to browse the update history of the specified files directly.
Why is there a project like SVN?
Official explanation: In order to take over the user base of CVS, to be exact, we wrote a new version control system, he is similar to CVS, but it fixes the problem that CVS does not solve. See the official website for details.
SVN is a very common software management system, it is often used to manage the program source code, but it can also manage any type of files, such as text, video, pictures and so on.
SVN-related sites:
Subversion website: https://subversion.apache.org
SVN client: http://tortoisesvn.sourceforge.net/
SVN Chinese site: http://svndoc.iusesvn.com/
English FAQ: https://subversion.apache.org/faq.zh.html
Official manual: http://svnbook.red-bean.com/
As of today's common version management software are: VSS, CVS, Starteam, SVN, GIT.
1.2 The difference between SVN and git 1.2.1 svn is a centralized version control system
The SVN version control system is a centralized data management, there is a central repository, all developers in the local development of the code used to come from this repository, the submission code must also be submitted to the central repository.
The SVN version control system workflow is as follows:
1. Create or punch the trunk to copy a branch on the central repository.
2. Check out the code for this branch from the central repository.
3. Go to your own branch and work on the development. Submit the code once every once in a while.
4. Commit code when it's time to get off the clock, assuming someone has submitted the code on the new branch, you'll be prompted for the code to expire, you'll have to update your local code and then update the commit. If there is a conflict at update, you need to resolve the conflict (code merge) after committing, submit your own branch code to the trunk.
Advantages:
1. SVN is more appropriate than git for the core code of some projects or for some important items with high confidentiality requirements.
2.SVN Support Empty Directory
3.SVN has better Windows platform support
4.SVN can check out/clone a subtree (sub-tree)
5.SVN supports privileged access control SVN lock, which is useful when working with files that are difficult to merge
6.SVN supports binary files, easier to handle large files (no need to copy the old version)
7. Easy to learn and simple to use
Disadvantages:
1. No network: Unable to submit code, unable to view historical version of code, unable to synchronize code
2. The code should be regularly backed up (all code data and version change records)
3. Slow Branch switching
4. Because each commit retains an original copy, SVN's database capacity is exploding. Especially in the case of very many developers.
1.2.2 Git is a distributed version control system
Operating mode:
Git does not have a central repository, but we usually build a remote git repository to facilitate code sharing for members of the development team. Unlike SVN, the developer also contains a completed Git repository, which, to a certain extent, is equivalent to the identity of the local repository and the remote repository, without the master or slave.
If your project is a closed-source project, or if you're used to the centralized management of the past, you can work with SVN under Git, but the process adds some steps.
1. You create a git repository locally and add it to a remote git repository
2. You change the file, and then commit, the commit is committed to the local Git repository (in fact, is committed to the local git directory in the object directory)
3. Push the branch of the local git repository to the branch of the remote Git repository, if the remote git repository already has someone push, then the remote Git repository is reluctant to push you, this time you have to pull, if there is conflict, handle the conflict, Commit to the local git repository after the push to the remote git library.
Advantages:
1. Easy and fast switching branch than SVN
2. The written code can be submitted at any time
3. Rich command line operations and combinations
4. Can one person a warehouse, warehouse can have multiple branches
Disadvantages:
1. Not a better Desktop integration tool
2. Binary files are not supported
3. High learning Costs
1.3 OPS personnel need to master the version management system
- installation, deployment, maintenance, troubleshooting
- Simple to use, many companies are managed by development, including building warehouses and adding delete accounts
- For version control system, operation and maintenance personnel to the equivalent of developers, developers are owners, operation and maintenance of the system for the development of personnel services
1.4 SVN service run mode and access mode 1.4.1 SVN server run mode
1. Standalone server access
Access address such as: svn://svn.test.com/test
2. HTTP services such as Apache
Access address such as: http://svn.test.com/test
A. Install APACHE+SVN separately
B.CSVN (APACHE+SVN) is a separate, integrated software with SVN software with web interface management
3. Local Direct access
Access address such as: file:///application/svndata/test
1.4.2 SVN Client access mode
The SVN client can access the server side in several ways, such as local disk access, or a variety of network protocol accesses, but a repository address is always only one url,url reflects the access method
Access mode |
Description |
file:/// |
Access repository directly from local disk or network disk |
/HTTP |
Access to the Apache server that supports subversion via the WebDAV protocol |
https:// |
Similar to/HTTP, but encrypted with SSL access |
svn:// |
Custom protocol access via TCP/IP is SVN server |
svn+ssh:// |
Access to SVN server through authenticated and encrypted TCP/IP custom protocol |
1.5 SVN file Data format
The SVN server stores data formats in 2 ways: BDB (a thing-safe table type) and FSFS (a storage system that does not require a database). Because the BDB mode is likely to lock the data when the server is interrupted, it is safer to FSFS.
BDB:
Berkeley DB (Berkeley db), the repository can be used by a fully tested background database implementation that can no longer be used on a network shared file system, Berkeley DB is the default repository format prior to the Subversion1.2 version
FSFS:
A file system backend dedicated to the Subversion repository, which can use a network file system (for example, NFS or SMBFS). is the default version library format for version 1.2 and later.
CVS is a version control system based on RCS files. Each CVS file is just an ordinary file, plus some additional information. These files will simply repeat the tree structure of the local file. Therefore, you do not have to worry about any data loss, and you can manually modify the RCS file if necessary.
SVN is the Fsfs of a BDB or a series of binary files based on a relational database. This solves many problems (such as parallel read and write shared files) and adds many new features (such as the things feature at run time). On the other hand, however, the data store becomes opaque and cannot see the entities ' files like Ftp,samba,nfs.
1.6 SVN version system logic architecture schematic diagram
1.7 SVN Release Management workflow
The core of centralized code management is the SVN server, where developers have to update code locally before starting a new day, and then develop, resolve conflicts, merge. All version information is placed on SVN.
Code Publishing Schema Scheme (SVN)