Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use svn client in linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to use the svn client in linux. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

1. Checkout the file to the local directory

Svncheckoutpath (path is the directory on the server)

For example: svncheckoutsvn://192.168.1.1/pro/domain

Abbreviation: svnco

2. Add new files to the version library

Svnaddfile

For example: svnaddtest.php (add test.php)

Svnadd*.php (add all php files in the current directory)

3. Submit the changed files to the version library

Svncommit-m "LogMessage" [- N] [--no-unlock] PATH (use the-- no-unlock switch if hold lock is selected)

For example: svncommit-m "addtestfileformytest" test.php

Abbreviation: svnci

4. Lock / unlock

Svnlock-m "LockMessage" [--force] PATH

For example: svnlock-m "locktestfile" test.php

SvnunlockPATH

5. Update to a certain version

Svnupdate-rmpath

For example:

If there is no directory behind svnupdate, by default, all files in the current directory and subdirectories will be updated to the latest version.

Svnupdate-r200test.php (restore the file test.php in the version library to version 200)

Svnupdatetest.php (updates, synchronized with the version library. If you are prompted to expire at the time of submission, it is due to a conflict. You need to update first, modify the file, then clear svnresolved, and then submit commit)

Abbreviation: svnup

6. Check the status of a file or directory

1) svnstatuspath (the status of files and subdirectories under the directory, which is not displayed in the normal state)

[?: not under the control of svn; M: content modified; C: conflict occurred; A: scheduled to be added to version library; K: locked]

2) svnstatus-vpath (display file and subdirectory 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 modifier.

Note: the three commands svnstatus, svndiff, and svnrevert can be executed without a network because svn retains the original copy of the local version in the local .svn.

Abbreviation: svnst

7. Delete files

Svndeletepath-m "deletetestfle"

For example: svndeletesvn://192.168.1.1/pro/domain/test.php-m "deletetestfile"

Or directly svndeletetest.php and then svnci-m'deletetestfile', recommends this kind of

Abbreviation: svn (del,remove,rm)

8. View the log

Svnlogpath

For example, svnlogtest.php displays all changes to this file and the changes in its version number

9. View file details

Svninfopath

For example: svninfotest.php

10. Compare the differences

Svndiffpath (compare modified files with base version)

For example: svndifftest.php

Svndiff-rm:npath (compare the difference between version m and version n)

For example: svndiff-r200:201test.php

Abbreviation: svndi

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

Svnmerge-rm:npath

For example: svnmerge-r200:205test.php (merge the differences between versions 200and 205 into the current file, but there are usually conflicts that need to be dealt with)

12. SVN help

Svnhelp

Svnhelpci

The above are common commands. Here are a few that are not commonly used.

13. List of files and directories under the version library

Svnlistpath

Show all files and directories that belong to the version library in the path directory

Abbreviation: svnls

14. Create a new directory under version control

Svnmkdir: create a new directory under version control.

Usage: 1. MkdirPATH...

2 、 mkdirURL...

Create a version-controlled directory.

1. Each directory specified with the working copy PATH will be created on the local side and added

Schedule for the next submission.

2. Each directory specified in URL is created by immediately submitting it to the repository.

In both cases, all intermediate directories must exist in advance.

15. Restore local modifications

Svnrevert: restore the original working copy file (restore most of the local modifications). Revert:

Usage: revertPATH...

Note: this subcommand will not access the network and will resolve the conflict condition. But it won't recover.

Deleted directory

16. Code base URL change

Svnswitch (sw): update the working copy to a different URL.

Usage: 1. SwitchURL [PATH]

2 、 switch--relocateFROMTO [PATH...]

1. Update your working copy and map it to a new URL, which behaves like "svnupdate" and will also change the

Files on the server are merged with local files. This corresponds to a working copy to a branch or tag in the same warehouse

Method.

2. Rewrite the URL metadata of the working copy to reflect the changes on the simple URL. When the root URL of the warehouse changes

(such as a change in the scheme name or host name), but the working copy is still used when mapping to the same directory in the same warehouse

This command updates the correspondence between the working copy and the warehouse.

17. Conflict resolution

Svnresolved: removes the "conflict" state of the directory or file of the working copy.

Usage: resolvedPATH...

Note: this subcommand does not resolve conflicts or remove conflict tags according to syntax; it just removes conflicts

After reading the above, do you have any further understanding of how to use the svn client in linux? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report