1. assume that the SVN database directory is/home/svn/projects2. start svnsvnserve-d -- listen-port9999-r/home/svn/projects (Note: Specify the port) or svnserve-d-r/home/svn/projects3. create a project & nbs
1. Assume that the SVN database directory is/home/svn/projects.
2. Start svn
Svnserve-d -- listen-port 9999-r/home/svn/projects (Note: Specify the port) or
Svnserve-d-r/home/svn/projects
3. Create a project
Svnadmin create/home/svn/projects
4. Add the project code to the/home/project directory to import the project code.
Svn import/home/project file: // home/svn/projects-m "Initial Projects" ("Initial Projects" is
Log Information)
5. Configure permissions
Go to/home/svn/projects/conf and change svnserve. conf
[General]
# Anon-access = read
Anon-access = none
Auth-access = write
Password-db = passwd
Realm = projects # The projects here are the directories in which the imported code is stored. Here the projects are/home/svn/projects/conf. You need to set them according to your own situation.
6. Create the file passwd in the/home/svn/projects/conf directory and add similar code
[Users]
Cynric = cyrnic (user name = user passwd)
7. svn command usage
1. Execute the file checkout in the Linux Command Line to the local directory.
Svn checkout path (path is the directory on the server) localpath (local path)
Example: svn checkout svn: // 192.168.1.1/pro/domain/home/program
2. Add a new file to the version library under the Linux Command Line
Svn add file
Example: svn add test. php (add test. php)
Svn add *. php (add all php files in the current directory)
3. Submit the changed files to the version library under the Linux Command Line.
Svn commit-m "LogMessage"
For example: svn commit-m "add test file for my test" test. php
4. View logs under Linux Command lines
Svn log path
For example, svn log test. php displays all the modification records of this file and changes to its version number.
5. Update a Linux Command Line to a specific version.
Svn update-r m path
For example:
If there is no directory after svn update, all files in the current directory and sub-directories are updated to the latest version by default. Abbreviation: svn up
Svn update-r 200 test. php (restore the file test. php In the version library to version 200)
6. view the file or directory status in the Linux Command Line
1) svn status path (the State of the files and subdirectories under the directory. The normal state is not displayed)
【? : Not under svn control; M: The content is modified; C: A conflict occurs; A: It is scheduled to be added to the version Library; K: it is locked]
2) svn status-v path (displays the status of files and subdirectories)
The first column remains the same, the second column displays the working version number, and the third and fourth columns show the last modified version number and modifier.
Abbreviation: svn st
7. delete files under the Linux Command Line
Svn delete path-m "delete test fle"
For example: svn delete svn: // 192.168.1.1/pro/domain/test. php-m "delete test file"
Or directly delete svn test. php and then svn ci-m 'delete test file'. We recommend that you use this
Abbreviation: svn (del, remove, rm)
8. Differences in Linux Command lines
Svn diff path (compare the modified file with the basic version)
Example: svn diff test. php
Svn diff-r m: n path (differences between version m and version n)
Example: svn diff-r 200:201 test. php
Abbreviation: svn di
9. In the Linux Command Line, merge the differences between the two versions into the current file.
Svn merge-r m: n path
For example, svn merge-r test. php (merge the differences between version 200 and version 205 to the current file, but there are usually conflicts. You need to handle them)
10. SVN help in Linux Command Line
Svn help
Svn help ci
For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10