1. Set up a Subversion server 1. First install the subversion software: sudoapt-getinstallsubversion. Note: Use apt-get to install the software. Ubuntu downloads the software to the/etc/bash_completion.d/directory by default, you can use sudoapt-getsourcepackagename to download the source code package, which is also downloaded to/etc/bas.
1. Build a Subversion server
1. First install the subversion software:
sudo apt-get install subversion
Note: Use apt-get to install the software. By default, Ubuntu downloads the software to the/etc/bash_completion.d/directory. You can use sudo apt-get source packagename to download the source package. /Etc/bash_completion.d.
2. Create a repo under/home/nicky, named svnproject:
svnadmin create /home/declan/svnproject
3. Import the content in the/fun/theme directory to this repo. Note: The file name in the imported directory cannot contain Chinese characters. Otherwise, an error occurs and the Import fails:
svn import -m "projectName" /fun/theme file:///home/declan/svnproject
4. Finally, create a svnserve that comes with svn for this repo:
svnserve -d -r /home/declan/svnprojec
5. The svn server uses the port number 3690 by default,To use a non-default port for svn, add -- listen-port 21 after svnserve to modify the port number used by svn,
Run the following command:
Svnserve-d-r/Home/declan/svnproject -- Listen-port 21
Note: The Red bold part is the SVN root directory.
You can also set different port numbers for different svn projects on the same svn server. For example, if another project named svntest is created under the declan directory, you can start
Svnserve-d-r/Home/declan/svntest -- Listen-port 3690
The svntest project listens to port 3690 (svn default). In this way, another svnserver is viewed when the netstat-ntlp process is used. On the client, the default connection is port 3690, you can also add ": 21" after the address, that is, colon + port number, to set the access port.
The above command should be used in bin/Under the svn installation directory.
6. view the process port number and end the process.
Run the sudo netstat-ntlp command to view the running status of the current system network server, and then run the sudo kill-9 pid to end the process.
Ii. Use Subversion
1. You can use the following command to obtain a wc, for example, name it projecout.
svn checkout svn://127.0.0.1/ projecout
Or abbreviated:
svn co svn://127.0.0.1/ projecout
2. If you need to send the modification FROM wc to repo.
First go to the wc directory, and then use the following command to send the modification to the repo:
svn commit -m "note"
Iii. Common commands:
Retrieve the specified version, for example, version 2:
svn checkout --revision 2 svn://....
Display submitted log information:
svn log
Display the latest information in the Library:
svn log --revision HEAD
4. Set User Authentication and corresponding permissions.
Now we first create a repo named project1 and then go to project1:
svnadmin create d:\svnprojects\project1
cd d:\svnprojects\project1
There are a bunch of directories under the project1 directory, enter conf and open svnserve. in the conf file, find the following lines and remove the '#' annotation symbol. Do not leave any spaces before each line.
anon-access = read
auth-access = write
password-db = passwd
Here, anon-access and auth-access are respectively anonymous and permission granted to authorized users. By default, anonymous users are given read-only permissions, which is good and we do not need to change them. However, if you want to reject access from anonymous users, you only need to change read to none. Passwd after password-db is the file path that defines the user name and password. This file is in the same directory as snvserve. conf by default. Let's see how to configure the content in passwd.
[user]
# harry = harryssecret
# sally = sallyssecret
Harry and sally define the username and password of the user who can write the repo respectively. We can add our username and password below, for example
testsvn = tester
This grants the user testsvn the permission to write data to the repo. After the storage disk exits, the svn server can be run! Put all the projects to be managed in the Directory d: \ svnprojects. Use the svnadmin create command as usual to create a repo. If you want to checkout repo, enter:
svn checkout svn://192.168.0.1/project1
If you want to use commit, enter the user name and password you just set:
svn commit -m "we are commiting changes!" --username testsvn --password tester