Build a local svn server with SVN built in Xcode
1. Open the terminal and create the svn resource library
Svnadmin create/Users/huton2/Desktop/SVNserver
The SVNserver here is the name of the SVN repository, so I am too lazy to create an empty folder on the desktop, after I enter svnadmin create on the terminal, I will drag the empty folder on the desktop into svnadmin create, so that we do not need to create an address by hand and the address is accurate.
Ii. Configure SVN Permissions
This is probably the case in the SVN resource library you created. Then we can modify the three files authz, passwd, and svnserve. conf and open them directly using a text tool.
1. authz
A. Before the modification,
[Groups]
# Harry_and_sally = harry, sally
# Harry_sally_and_joe = harry, sally, & joe
# [/Foo/bar]
# Harry = rw
# & Joe = r
# * =
B. After the modification, this is the case.
[Groups]
# Harry_and_sally = harry, sally
# Harry_sally_and_joe = harry, sally, & joe
TestGroup = zhuzhuxia, xiaofeifei
[/]
@ TestGroup = rw
[/]
Zhuzhuxia = rw
Xiaofeifei = rw
# [/Foo/bar]
# Harry = rw
# & Joe = r
# * =
Obviously there is such a string in the middle.
TestGroup = zhuzhuxia, xiaofeifei
[/]
@ TestGroup = rw
[/]
Zhuzhuxia = rw
Xiaofeifei = rw
First, testGroup is the name of the group you created. It is customized and can be written at will.
Zhuzhuxia and xiaofeifei are members of your group.
[/]
@ TestGroup = rw
[/]
Zhuzhuxia = rw
Xiaofeifei = rw
This is the so-called configuration permission. [/] represents all the resources in your SVN. In addition, @ testGroup = rw indicates that all the members of this group have read and write permissions on all the resources in SVN, rw = read and write
Why do we need to add
[/]
Zhuzhuxia = rw
Xiaofeifei = rw
I am not very clear about this string. After all, this is rarely involved.
2. passed
Set the password when the member is added.
Before modification:
[Users]
# Harry = harryssecret
# Sally = sallyssecret
After modification:
[Users]
# Harry = harryssecret
# Sally = sallyssecret
Zhuzhuxia = 123456
Xiaofeifei = 123456
3. svnserve. conf
Before modification:
Here are four paragraphs. Find them by yourself.
# Anon-access = read
# Auth-access = write
# Password-db = passwd
# Authz-db = author
After modification:
Delete the spaces and # in front of each segment #,
It is worth noting that anon-access = read indicates that it is used for others to anonymously view your resources, but it only has the viewing function,
Anon-access = none indicates that you must have an account and password to view the resource.
Anon-access = none
Auth-access = write
Password-db = passwd
Authz-db = author
In this way, SVN permissions are configured.
Iii. Start SVN
Svnserve-d-r/Users/huton2/Desktop/SVNserver
To prevent errors, we drag the following resource library address to the terminal directly, instead of hand-writing.
After you press enter, if the terminal does not prompt, it will basically succeed.
Of course, you can also use the activity monitor that comes with the system to search for svn and then you will see svn.
4. import the project file
Svn import/Users/huton2/Desktop/testDemo svn: // localhost/SVNserver -- username = zhuzhuxia -- password = 123456-m "pig here"
/Users/huton2/Desktop/testDemo is the project folder you want to submit,
Svn: // localhost/SVNserver is the name of the folder in the local SVN resource library. You do not need to drag the file because the local svn can be detected after svn is started.
If you want to create multiple groups for a single project, you may need to store the specific source files in a specific group. For example, we need to import the source files to the SVNserver sub-Folder hollo, then our address becomes svn: // localhost/SVNserver/hello, and the subsequent address should change accordingly.
-M "here" this is a comment and must be written. Of course I mean-m "". If you don't want to write in a comment, you just need to give a space character, but never write anything.
During import, he will ask you to provide your SVN account and password. Just do what it says.
V. checkOut a source file
Do not say that the source file is uploaded from you. You do not need to check it. What you need is that your source file probably does not have the SVN right. updata, commit, and push
Svn checkout svn: // localhost/SVNserver -- username = zhuzhxia -- password = 123456/Users/huton2/Desktop/project
GROUP: svn checkout svn: // localhost/SVNserver/hello -- username = zhuzhxia -- password = 123456/Users/huton2/Desktop/project
Svn: // localhost/SVNserver is the address of your resource library, which is the same as that during import.
/Users/huton2/Desktop/project is the address where you want to check the resource
Composition: svn check + resource library address + SVN account + password + specified local folder address
You also need to enter the password after entering the command.
If an error occurs, the command line of the output user is displayed again, just like me.
6. Use Xcode check source files
Open Xcode and click Check out an existing project.
Go to the next page and enter the SVN address at or enter a repository location:
My address is svn: // 192.168.8.wangnima/SVNserver. I just don't want to tell you how there may be an amazing IP address like 192.168.8.wangnima!
Address composition: svn: // IP address of the SVN Resource Repository owner + Resource Repository name: svn: // 192.168.8.wangnima/SVNserver
GROUP: svn: // IP address of the SVN repository owner + resource library name + sub-File Name: svn: // 192.168.8.wangnima/SVNserver/hello
Normally, no error message is displayed in the lower left corner of the check Out interface. You can enter your svn account and password as prompted,
Anyone will save the file after clicking next!