Long time ago to use the SVN management code!! Not used for a long time, old knowledge review!! According to oneself convention, an article!! 😂 😂 😂 😂 😂

What Version Control does: keep track of file changes.

File backup; The file name stores the version number or date; In the multi-person editing environment, a file directory is shared, and each person is required to make the required logo on the file after editing.

Version control system:

VCS, also known as the “file database,” tracks file changes to avoid confusion.

Repository:

Repository also known as warehouse, English name :repository. It can be thought of as a directory where all files can be managed by the version control system, and the “modifications” and “deletations” of each file can be tracked so that the history can be traced at any time and the “restore” can be traced at any time in the future.

Git and SVN:

Git: Everyone has a complete repository on their computer

SVN: The repository is centrally stored on a central server.

The biggest problem with centralized version control systems is that they have to be connected to the Internet to work.


SVN

On Windows, use the TortoiseSVN option. In the Mac environment, the Mac provides the server and client functions of the SVN. Therefore, you can use the SVN function without installing any third-party software. You need to perform some simple configurations.

Setting up the SVN Server

Create an SVNs directory under any of the directories (/User/gyh/), and then you can create (place) multiple repository directories under the SVNs directory (/Users/gyh/SVNs).

Open the terminal and create oneRepoOfmy warehouse, input instructions:svnadmin create /Users/gyh/SVNs/repoOfmyAfter the command is successfully executed, /Users/gyh/SVNs/ is added to the hard diskrepoOfmydirectory, the directory structure is as follows:

Configure SVN user permissions: () the conf folder in “/ Users/gyh/SVNs/repoOfmy/conf/” directory, there are three access files: Conf GYHdeMacBook-Pro:conf gyh$ls authz hook-env.tmpl passwd svnserve.conf

  • Open Authz: User permission assignment content (vi Authz)

[groups] # admins is a group name, admin is a group name (can write multiple, separated by “, “) Admins =admin,gyh,coco) admins=admin # harry_and_sally = Harry, Sally # harry_sally_and_Joe = Harry, Sally,& Joe

[/foo/bar] # harry =rw # & Joe =r # * = [/] @admins=rw # [/] @admins=rw # [/] @admins=rw # [/foo/bar] # harry =rw # & Joe =r # * = [/] @admins=rw Admin =rw, and only the admin user is granted the read/write permission. * = r: Other users can only read; * = rw: other users have read/write permissions.

  • Enable passwd: Set the password of the SVN user (vi passwd)

[users] # corresponds to the user name of authz followed by the user password admin=abc123

# harry = harryssecret

# sally = sallyssecret

  • Conf: SVN configuration information (vi svnserve.conf)

The configuration items are as follows: (remove # and Spaces) # anon-access = read # Anonymous user has read permission # auth-access = write # Login user has write permission

# passwd = passwd # authz = authz # authz = authz # Anon-access = none # auth-access = write

# Authz authZ -db = authZ # Authz authz-db = authZ

Starting the SVN server: [](SVNserve-d-r /Users/gyh/SVNs) gyhdemacbook-pro :conf gyh$SVNserve-d-r /Users/gyh/SVNs or gyhdemacbook-pro :conf Gyh $SVNserve-d-r /Users/gyh/SVNs/repoOfmy

If you repeatedly start the server, an error will be reported:

GYHdeMacBook-Pro:conf gyh $ svnserve -d -r /Users/gyh/SVNs GYHdeMacBook-Pro:conf gyh $ svnserve -d -r /Users/gyh/SVNs svnserve: E000048: Can't bind server socket: Address already in use

Shutting down the SVN server:

The SVN server environment is set up.

1. Import code from local to server (first time: initial import)

Format: SVN import project path server address –username= username –password= password -m “comment content”

Example: SVN import/Users/gyh/Documents/project SVN: / / localhost/ios/project – the username = gyh – password = abc123 -m “initialization import”

SVN import/Users/gyh/Documents/project – the username = gyh – https://123.45.67.890/ios/project password = abc123 -m “initialization import” (HTTPS: corresponding server address)

Will “/ Users/gyh/Documents/project”, all of the content uploaded to the server ios warehouse project directory (back in double quotes “initialization import” is a comment).

2. Download the code from server to client local (checkout)

Format: SVN checkout server address –username= username –password= local path where the password is stored

Example: SVN checkout https://123.45.67.890/ios/project – username = gyh – password = abc123 -m “initialization import/Users/gyh/Desktop/project (HTTPS: corresponding server address)

To download the content of the project the warehouse in the server to the local “/ Users/gyh/Desktop/project” directory.

SVN import/Users/gyh/Desktop/Company/project documentation – username = gyh svnDocuments https://123.45.67.890/svn/res/ – password = abc123 500 – m “import first” SVN checkout https://123.45.67.890/svn/res/ project documentation – username = gyh – password = abc123 /Users/gyh/Desktop/Company/svnDocuments

3. Commit the changed code to the server (non-file path modifications)

  • < 1 >. The first positioning to/Users/gyh/Desktop/project directory

CD/Users/gyh/Desktop/project"

  • <2>. Enter the submit instruction

Format: SVN commit -m “Modified content”

Example: CD/Users/gyh/Desktop/project”

SVN commit -m "Modified plist file"

Will “/ Users/gyh/Desktop/project” under all changes are synchronized to the server.

4. Update: the server-side code to the client (SVN update) CD/Users/gyh/Desktop/project “SVN update

5. Other uses of SVN (SVN help)

GYHdeMacBook-Pro:ios gyh$ svn help usage: svn <subcommand> [options] [args] Subversion command-line client. Type 'svn help <subcommand>' for help on a specific subcommand. Type 'svn --version' to see the program version and RA modules or 'svn --version --quiet' to see just the version number. Most subcommands take file and/or directory arguments, recursing on the directories. If no arguments are supplied to such a command, it recurses on the current directory (inclusive) by default. Available subcommands: add auth blame (praise, annotate, ann) cat changelist (cl) checkout (co) cleanup commit (ci) copy (cp) delete (del, remove, rm) diff (di) export help (? , h) import info list (ls) lock log merge mergeinfo mkdir move (mv, rename, ren) patch propdel (pdel, pd) propedit (pedit, pe) propget (pget, pg) proplist (plist, pl) propset (pset, ps) relocate resolve resolved revert status (stat, st) switch (sw) unlock update (up) upgrade Subversion is a tool for version control. For additional information, see http://subversion.apache.org/Copy the code

Where, the content in parentheses generally represents the instruction for short. For example, use ** SVN CI to replace SVN commit and SVN co to replace SVN checkout**.



##SVN step:

SVN add * // Add all paths

The simplest steps: < 1 >. First positioning to/Users/gyh/Desktop/project directory CD/Users/gyh/Desktop/project “< 2 >. Enter the format of the commit command: SVN commit -m “Modified content”

##### Standard procedures: a. repository: a place where source code is stored uniformly

B. Checkout (extract) : When you don’t have the source code, you need to Checkout a SVN Checkout SVN address from your repository

C. Commit: When you have changed the code, you need to Commit to the repository SVN Commit -m “modified content”

D. Update: When you have checked out a copy of the source code and Update it, you can synchronize it with the source code in the Repository, and the code at hand will have the latest changes.

Development process: checked out code → Update(get the latest code) → make your own changes and debug successfully → Commit(Commit, everyone can see your changes)

Multi-player development :(similar to git) if two programmers modify the same file, SVN can Merge their changes by default. SVN actually manages source code in lines: whenever two programmers make changes that are not on the same line of the program, SVN automatically merges the changes. If it is the same line, the SVN prompts: file Confict. You need to confirm and resolve the problem manually.

Reference: Brief analysis of the usage of SVN subcommand add

This section describes how to use Subversion on the MAC



Error:

Goyohol ‘s essaysvn checkout https://123.45.67.890/ios/project – username = gyh – password = abc123 -m “initialization import” / Users/gyh/Desktop/project corresponding server address (HTTPS:)

To download the content of the project the warehouse in the server to the local “/ Users/gyh/Desktop/project” directory.

SVN import/Users/gyh/Desktop/Company/project documentation – username = gyh svnDocuments https://123.45.67.890/svn/res/ – password = abc123 500 – m “import first” SVN checkout https://123.45.67.890/svn/res/ project documentation – username = gyh – password = abc123 /Users/gyh/Desktop/Company/svnDocuments

3. Commit the changed code to the server (non-file path modifications)

  • < 1 >. The first positioning to/Users/gyh/Desktop/project directory

CD/Users/gyh/Desktop/project"

  • <2>. Enter the submit instruction

Format: SVN commit -m “Modified content”

Example:

CD/Users/gyh/Desktop/project"

SVN commit -m "Modified plist file"

Will “/ Users/gyh/Desktop/project” under all changes are synchronized to the server.

4. Update: the server-side code to the client (SVN update) CD/Users/gyh/Desktop/project “SVN update

5. Other uses of SVN (SVN help)

GYHdeMacBook-Pro:ios gyh$ svn help usage: svn <subcommand> [options] [args] Subversion command-line client. Type 'svn help <subcommand>' for help on a specific subcommand. Type 'svn --version' to see the program version and RA modules or 'svn --version --quiet' to see just the version number. Most subcommands take file and/or directory arguments, recursing on the directories. If no arguments are supplied to such a command, it recurses on the current directory (inclusive) by default. Available subcommands: add auth blame (praise, annotate, ann) cat changelist (cl) checkout (co) cleanup commit (ci) copy (cp) delete (del, remove, rm) diff (di) export help (? , h) import info list (ls) lock log merge mergeinfo mkdir move (mv, rename, ren) patch propdel (pdel, pd) propedit (pedit, pe) propget (pget, pg) proplist (plist, pl) propset (pset, ps) relocate resolve resolved revert status (stat, st) switch (sw) unlock update (up) upgrade Subversion is a tool for version control. For additional information, see http://subversion.apache.org/Copy the code

Where, the content in parentheses generally represents the instruction for short. For example, use ** SVN CI to replace SVN commit and SVN co to replace SVN checkout**.



##SVN step:

SVN add * // Add all paths

The simplest steps: < 1 >. First positioning to/Users/gyh/Desktop/project directory CD/Users/gyh/Desktop/project “< 2 >. Enter the format of the commit command: SVN commit -m “Modified content”

##### Standard procedures: a. repository: a place where source code is stored uniformly

B. Checkout (extract) : When you don’t have the source code, you need to Checkout a SVN Checkout SVN address from your repository

C. Commit: When you have changed the code, you need to Commit to the repository SVN Commit -m “modified content”

D. Update: When you have checked out a copy of the source code and Update it, you can synchronize it with the source code in the Repository, and the code at hand will have the latest changes.

Development process: checked out code → Update(get the latest code) → make your own changes and debug successfully → Commit(Commit, everyone can see your changes)

Multi-player development :(similar to git) if two programmers modify the same file, SVN can Merge their changes by default. SVN actually manages source code in lines: whenever two programmers make changes that are not on the same line of the program, SVN automatically merges the changes. If it is the same line, the SVN prompts: file Confict. You need to confirm and resolve the problem manually.

Reference: Brief analysis of the usage of SVN subcommand add

This section describes how to use Subversion on the MAC



Error:

(2017.10.09)

goyohol’s essay