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 common commands of SVN under Linux

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article will explain in detail what SVN commands are commonly used under Linux. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

SVN is an open source version control system. By using the efficient management of branch management system, in short, it is used for multiple people to jointly develop the same project, to achieve shared resources, and to achieve the final centralized management.

1. Checkout the file to the 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 a new file svn add file to the version library 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 svn commit-m "LogMessage" [- N] [- no-unlock] PATH (use the-no-unlock switch if you choose to keep the lock) for example: svn commit-m "add test file for my test" test.php abbreviation: svn ci

4. Lock / unlock svn lock-m "LockMessage" [- force] PATH for example: svn lock-m "lock test file" test.phpsvn unlock PATH

5. Update to a version of svn update-r m path for example: svn update if there is no directory behind, by default all files in the current directory and subdirectories will be updated to the latest version. Svn update-r 200 test.php (restore the file test.php in the version library to version 200) svn update test.php (update, synchronize 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 svn resolved, and finally submit commit) abbreviation: svn up

6. View file or directory status 1) svn status path (status of files and subdirectories under the directory, not displayed normally) [?: not under the control of svn; M: content modified; C: conflict; A: scheduled to be added to the version library K: locked] 2) svn status-v path (showing 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 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 the file 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 svn log path for example: svn log test.php shows all the changes to the file and the changes in its version number

9. View file details svn info path for example: svn info test.php

10. Compare the difference svn diff path (compare the modified file with the base version) for example: svn diff test.phpsvn diff-r MVA n path (compare the difference between version m and version n) for example: svn diff-r 200 svn diff 201 test.php abbreviation: svn di

11. Merge the differences between the two versions into the current file svn merge-r MVA n path for example: svn merge-r 200 test.php 205 test.php (merge the differences between versions 200 and 205 into the current file, but generally there will be conflicts and need to be dealt with)

12. SVN helps svn helpsvn help ci

This is the end of this article on "what are the common SVN commands under Linux?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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

Development

Wechat

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

12
Report