In Mac system, because Mac comes with SVN server side and client function, so we can use SVN function without any third party software, but need to do some simple configuration
Create a code Warehouse
I first in~A new SVN directory is created under the directory
$mkdir svn
Create a warehouse, the name is random, my name ismycode
$svnadmin create ~/svn/mycode
The directory structure should resemble the following:
$ ls svn/mycode/
README.txt conf/ db/ format hooks/ locks/
Configure user permissions for SVN
Modify~/svn/mycode3 files in a directory
1. Opensvnserve.conf, remove the preceding # and space of the following configuration items
anon-access = read
auth-access = write
password-db = passed
authz-db = author
anon-access = readAnonymous access on behalf of the time is read-only, if theanon-access = nonerepresentative to prohibit anonymous access, requires an account password to access
2. Openpasswd,[users]Add the account number and password below, for example:
[users]
benjamin=abc
The account number is Benjamin Password is ABC
3. Openauthz, configure user groups and permissions
We can assign the users in the passwd to different user groups, later, you can set different permissions for different groups of users, there is no need to set permissions for each user individually.[groups]Add the group name and user name below, separated by commas between multiple users(,)
[groups]
mygroup = benjamin
Note that Benjamin belongs to the MyGroup group, and then the permissions are configured. Use [/] to represent all repositories in the SVN server
[/]
@mygroup = rw
The above configuration instructions MyGroup all the users in this group have read and write (rw) permissions for all repositories, and the group name is preceded by the @
If it is a user name, do not add @, such as Benjamin This user has read and write permissions
[/]
benjamin = rw
For other fine-grained permission controls, you can refer to other content in the Authz file
4. Start the SVN server
Before the configuration of so many, the most critical or to see whether the normal start of the server, if not to start, do more work in the front is futile.
Enter the following command at the terminal:
svnserve -d -r ~/svn
or enter:
svnserve -d -r ~/svn/mycode
Without any hint, it means the boot was successful.
5. Close the SVN server
If you want to shut down the SVN server, the most effective way is to open the utility's "Activity Monitor"
After I have configured the SVN, I want to download the document, because SVN is abroad, it may take a day, so I directly to the Windows system downloaded documents copied to the Mac.
I put it under the~/Documents/catalogue.
When I entered the document directory$ svn update, I was prompted with an error
Svn:E155021:This client is too old to work with the working copy at
'/users/piqiu1/documents/7day-sysdoc ' (format 31).
You need to get a newer Subversion client. For more details, see
Http://subversion.apache.org/faq.html#working-copy-format-change
After the search, it was found that the SVN client needs updating.
MAC OS Upgrade SVN client
$ svn--version
get version is 1.7.20
go to Mac OSX svnclient find the corresponding Mac version and SVN client version download, double click to install.
installation is complete, the last step prompts you to add the SVN address to the path variable, and then execute the following command at the terminal
$ cd ~
$ vi. bash_profile
in. Bash_ Add a line to the profile file
export path=/opt/subversion/bin: $PATH
After you update the environment variables under bash
$ source. Bash_ Profile
Run SVN command again
$ svn--version
Get version Yessvn, version 1.9.2 (r1703836)
Go to the Documentation directory and execute again$ svn update
Everything appears normal until a new conflict occurs after the server user name and password have been entered
Skipped ' 0.6 External interfaces/09. Printshop/welcome Package Loan sdfbresva-r5.0.xlsx "--Node remains in conflict
At revision 1723.
Summary of conflicts:
Skipped paths:1
Finally, execute the following command to resolve the conflict
$ svn revert ‘0.6 External Interfaces/09. Printshop/Welcome Package Loan SDFB RESVA - R5.0.xlsx‘
Mac OS SVN configuration usage and conflict resolution