Linux experts note the use of the road --- SVN

SVN is the next version of CVS, mainly used for version control, program code, audio, video and image files, do version control.

Subversion is a directory and file objects can be recorded version. The main works in the following figure:
                   _ _ _ _ _ _ _ _ _ _
                  / \
                  | |
                  | project warehouses |
                  | |
                  \ _ _ _ _ _ _ _ _ _ _ /
                        / |
                       / the Check in |
     the Check OUT / |
_ _ _ _ _ _ / _ _ _ | _ _ _ _ _ _ _                   
/ \ / \
| | | |
| working copy | | working copy |
| | | |
\ _ _ _ _ _ _ _ _ / \ _ _ _ _ _ _ _ _ /

Branch, trunk, merging, tags
when creating a branch or tag, use a "delayed copy" technology, that is, only Creating a link pointing to the same version, when one of these files is subject to change, go to copy that file or directory.
Generally speaking, the branch is used to make ready to publish, rather than parallel development.

1, create a project repository
svnadmin create / home / huzza / test_svn

2, import the original file to the project repository
svn import -m source_file_path URL
in this case the URL of: File: /// Home / huzza / test_svn / Sesame / Trunk
File: // ------> told a local directory svn

3, checkout files to a local directory
svn Checkout (CO) File: /// Home / huzza / test_svn / Sesame / Trunk Sesame

4, or to check the status of file
svn status [file / directory]
the svn log [file / directory]
the svn log -R6: 8 [file / directory] View log between 8 version to version 6

5, file / directory comparison (compared with the project to create a working copy library)
svn diff [file / directory] or svn diff --rHEAD [file / directory] --rHEAD: indicates the latest version

6, update the local copy of the work, submit work to modify
svn update (up) [file / directory] svn checkin (in) -m " comments" [ file / directory]
files flag of Update:
     U ------ representation file is updated
     G ------ represents a project to create files in the library and the local working copies of the files are merged together into a
     C ------ indicate when combined, produce a conflict
     a ------ newly added a file
     D ------ delete a file
     ? ------ means that the file or directory is not svn management
     M ------ this file is modified

7, conflict. When svn update, there is a conflict if a file exists, open the file conflict, <<<<<<<< and >>>>>>>> shows local conflict.
When a collision occurs, if you want to use the project repository version, and give modify the local copy, you can use the following command:
A, svn Revert [file conflict / directory]
b, svn Update [file conflict / directory]
(svn resolved [file / directory] && svn updata [file / directory], seems ok, you need to confirm it)
if you want to keep the modified local working copy, and give up the project version of the warehouse modifications, can be as follows:
a, cp file / .mine directory file / directory
b, svn resolved file / directory
c, svn ci -m "use my version please" file / directory
(in the above three steps, the steps do not seem to be a purpose)

8, the svn repository networking project
start svn server: svnserve --daemon --root / home / huzza / test_svn
row of server resources: svn list svn: //192.168.0.4/sesame/trunk
different back out of the URL, other operations For each section, the same
svn + ssh access: svn list svn + ssh: //192.168.0.4/sesame/trunk ( need to support ssh access on the server)

9, get a specific version of a working copy
svn Checkout -rVersionNum List svn: //192.168.0.4/sesame/trunk Butterfly
svn info Butterfly (see the current version of the copy of the state)

10, copy / move a file
the svn Copy filename newfile
the svn newfile Move oldfile to
the svn CI -m "Move some or the Add Files" [where to modify the file directory] (herein also make sure that with the local copies of the same operation on the server)

11, the version of the symbol
HEAD --------- warehouse project in the latest version
BASE --------- working copy of the standard version (ie version of checkout out)
COMMITTED ---- last checkin version of
a previous version of PREV --------- COMMITTED

12, to find the differences between the versions
svn diff -r2: 4 [file / directory]
the svn the diff> diffname.patch (to generate patch files)
using the patch file: patch -p0 -i diffname.patch

13, after deleting a version of the previous version of the modified
svn merge -r27: 26 [file / directory] && "undo the work of version 27" svn ci -m
modifications made to revoke version 27

14、创建分支/标签
svn mkdir -m "Create branches" svn://192.168.0.4/sesame/branches
svn copy -m "Create release branches for version 1.0" svn://192.168.0.4/sesame/trunk \
                                                         svn://192.168.0.4/sesame/branches/release-1.0

Reproduced in: https: //www.cnblogs.com/licheng/archive/2008/11/08/1329634.html

Guess you like

Origin blog.csdn.net/weixin_33896069/article/details/92633217