Home > php教程 > PHP开发 > linux svn use

linux svn use

黄舟
Release: 2016-12-13 13:52:42
Original
1101 people have browsed it

svn add values/strings.xml //--Add

svn st //--View status

svn ci //--Submit svn ci -m "svn ci, permission"

1. Checkout the file to Local directory

svn checkout path (path is the directory on the server)
For example: svn checkout svn: // 192.168 . 1.1 / pro / domain
Abbreviation: svn co

2. Add new files to the repository

svn add file
For 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 repository

svn commit - m " LogMessage " [ -N ] [ --no-unlock ] PATH (If you choose to keep the lock, use the --no-unlock switch)

For example: svn commit -m " add test file for my test " test.php C Brief as: SVN CI写4, lock/unlock

SVN LOCK -M "LockMessage" [ -FORCE] PATH

For example: SVN LOCK -M "LOCK TEST FILE" TEST.PHP

SVN UNLOCK PATH

5555555 , Update to a certain version

svn update -r m path

For example:

svn update If there is no directory after it, all files in the current directory and subdirectories will be updated to the latest version by default.

svn update -r 200 test.php (Restore the file test.php in the repository to version 200)

svn update test.php (Update, synchronize with the repository. If it is prompted to expire when submitting, it is because of a conflict , you need to update and modify the file first, then clear svn resolved, and finally submit commit)
Abbreviation: svn up

6. Check the file or directory status

1) svn status path (the status of files and subdirectories in the directory, normal The status is not displayed)

[?: Not under svn control; M: The content is modified; C: Conflict occurs; A: Scheduled to be added to the repository; K: Locked]

2) svn status -v path (displays files and subtitles Directory status)

The first column remains the same, the second column shows the working version number, and the third and fourth columns show the last modified version number and the person who modified it.

Note: The three commands svn status, svn diff and svn revert can also be executed without a network. The reason is that svn retains the original copy of the local version in the local .svn.
Abbreviation: svn st

7. Delete files

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 svn delete test.php and then svn ci -m 'delete test file', it is recommended to use this

abbreviation: svn (del, remove, rm)


8. Check the log

svn log path

For example: svn log test.php displays all modification records of this file and changes in version numbers

9. View file details


svn info path

For example: svn info test.php

10. Compare differences


svn diff path (Compare the modified file with the base version)

For example: svn diff test.php

svn diff -r m:n path (Compare the difference between version m and version n)

For example: svn diff -r 200:201 test.php

Abbreviation: svn di

11. Merge the differences between the two versions into the current file

svn merge -r m:n path

For example: svn merge -r 200 : 205 test.php (change the difference between version 200 and 205 The differences between the files are merged into the current file, but conflicts usually occur and need to be dealt with)

12. SVN help


svn help

svn help ci

---------------- -------------------------------------------------- ------------


The above are commonly used commands, here are some less frequently used ones

--------------------- -------------------------------------------------- ------- Come

13. List of files and directories under the repository

svn list path

Display all files and directories belonging to the repository under the path directory

Abbreviation: svn ls

14. Create and include New directory under version control

svn mkdir : Create a new directory under version control.
Usage: 1. mkdir PATH...
    2. mkdir URL...
Create a version-controlled directory.
1. Each directory specified by the working copy PATH will be created locally, and a new
schedule will be added to wait for the next submission.
2. Each directory specified by URL will be created in the warehouse through immediate submission.
In both cases, all intermediate directories must exist beforehand.

15. Restore local modifications

svn revert: Restore the original unchanged working copy file (restore most local modifications). revert:
Usage: revert PATH...
Note: This subcommand will not access the network and will resolve the conflict. But it will not restore the deleted directory

16. Code base URL change

svn switch (sw): Update the working copy to a different URL.

Usage: 1. switch URL [PATH]
2. switch --relocate FROM TO [PATH...]

1. Update your working copy and map it to a new URL. Its behavior is very similar to "svn update" Like, files on the server will also be merged with local files. This is a way to map a working copy to a branch or tag in the same warehouse.

2. Rewrite the URL metadata of the working copy to reflect the simple changes in the URL. When the root URL of the warehouse changes
(such as the solution name or host name changes), but the working copy is still mapped to the same directory in the same warehouse, use
This command to update the corresponding relationship between the working copy and the warehouse.


17. Resolve conflicts

svn resolved: Remove the "conflict" status of the working copy's directory or file.

Usage: resolved PATH...

Note: This subcommand does not resolve conflicts or remove conflict markers based on syntax; it only removes the conflicting

related files, and then allows PATH to be submitted again.


Related labels:
svn
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template