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

What are the commonly used svn commands under the Linux command line

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces which commonly used svn commands are under the Linux command line, the article is very detailed, has a certain reference value, interested friends must read it!

1. Checkout the file to the local directory under the Linux command line

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 version library under the Linux command line

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 version library under the Linux command line

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

For example: svn commit-m "add test file for my test" test.php

Abbreviation: svn ci

4. Add / unlock under the Linux command line

Svn lock-m "LockMessage" [--force] PATH

For example: svn lock-m "lock test file" test.php

Svn unlock PATH

5. Update to a certain version under the Linux command line

Svn update-r m path

For example:

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

Svn update-r 200 test.php (restore the file test.php in the version library to version 200)

Svn update test.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, and then clear svn resolved,*** before submitting commit)

Abbreviation: svn up

6. Check the status of files or directories under the Linux command line

1) svn status path (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) svn status-v path (showing file and subdirectory status)

The * columns remain the same, the second column shows the working version number, and the third and fourth columns show the version number and the person who modified it once.

Note: the three commands svn status, svn diff, and svn revert can be executed without a network because svn retains the original copy of the local version in the local .svn.

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 svn delete test.php and then svn ci-m 'delete test file', recommend this

Abbreviation: svn (del, remove, rm)

8. View the log under the Linux command line

Svn log path

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

9. View file details under the Linux command line

Svn info path

For example: svn info test.php

10. Compare the differences under the Linux command line

Svn diff path (compare modified files with base version)

For example: svn diff test.php

Svn diff-r MVA n path (compare the difference between version m and version n)

For example: svn diff-r 20014 0201 test.php

Abbreviation: svn di

11. Merge the differences between the two versions into the current file under the Linux command line

Svn merge-r mpurn path

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

12. SVN help under the Linux command line

Svn help

Svn help ci

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

13. List of files and directories under the version library under the Linux command line

Svn list path

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

Abbreviation: svn ls

14. Create a new directory under version control under the Linux command line

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 with 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 in URL will be created by submitting it to the warehouse immediately. In both cases, all intermediate directories must exist in advance.

15. Restore local modifications under the Linux command line

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

Usage: revert PATH...

Note: this subcommand will not access the network and will resolve the conflict condition. But it will not restore the deleted directory

16. Change the code base URL under the Linux command line

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 to a new URL, which behaves like "svn update" and merges files on the server with local files. This is the 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 changes on the simple URL. Use this command to update the correspondence between the working copy and the repository when the root URL of the repository changes (for example, the scheme name or host name changes), but the working copy is still mapped to the same directory in the same warehouse.

17. Resolve conflicts under the Linux command line

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

Usage: resolved PATH...

Note: this subcommand does not resolve conflicts or remove conflict tags by syntax; it simply removes files related to conflicts and then allows PATH to submit them again.

18. Output the contents of the specified file or URL under the Linux command line.

Svn cat target [@ version]... If a version is specified, the search starts with the specified version.

Svn cat-r PREV filename > filename (PREV is the previous version, and you can also write a specific version number so that the output result can be submitted)

These are all the contents of this article entitled "what are the commonly used Linux commands under the svn command line?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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