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 is the most commonly used svn command in Linux systems?

2025-01-16 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 the most commonly used svn command in the Linux system refers to. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

SVN is an open source version control system using branch management system, which can develop a project by multiple people at the same time to achieve the purpose of sharing resources. The following is to share with you the most commonly used commands of svn in the Linux system, which can be referred to by friends in need.

About svn: Subversion (SVN) is an open source version control system, which means that Subversion manages data that changes over time.

The data is placed in a central data archive (repository). This archive is very much like an ordinary file server, but it remembers every change of the file. In this way, you can restore the file to the old version, or browse the change history of the file.

Common command 1, svn checkout pathpath is the directory on the server.

Svn checkout path for example: svn checkout svn://192.168.1.1/pro/domain abbreviation: svn co1.1 svn checkout path subv this will put your working copy in subv instead of trunk as before

2. Svn add filefile is a file or a directory. If you add all the files, use the dot. It means.

Svn add file for example: svn add test.php svn add *. Php (add all php files in the current directory) svn add. (means to add all files) 3. Svn commit submit files to the server.

Svn commit-m "LogMessage" [- N] [--no-unlock] path (use the-no-unlock switch if you choose to hold the lock) for example: svn commit-m "add test file for my test" test.php abbreviation: svn ci General steps:

Step-1:svn update

Step-2:svn add file 、 svn delete file

Step-3:svn commit-m "submit files to remote server"

4. Svn lock lock / unlock command.

Svn lock-m "LockMessage" [--force] path for example: svn lock-m "lock test file" test.php svn unlock path5, svn update update command.

Svn update-r m path for example: 1. There is no directory after svn update, and all files in the current directory and subdirectories are updated to the latest version by default. 2. Svn update-r 200 test.php (restore the file test.php in the version library to version 200) abbreviation: the svn upupdate command can also restore files. (1) accidentally wrote a lot of things wrong, want to undo what you wrote (have submitted the changes to the server) svn update-r version number (2) accidentally deleted the wrong file, want to restore the file (delete has been submitted to the server) 
 svn update-r version number

6. Svn status svn status-v path svn status path abbreviation: svn st displays the status of files and subdirectories. 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.

File status description

An is added to the local code repository

'' no modification

C conflict

D deleted

I was ignored

M has been modified

R is replaced

The version directory created by X external definition

? The file was not added to the local version library

! Missing or incomplete files (files that are not deleted by the svn command)

~ controlled files are blocked by other files

7. Svn delete deletes files.

Svn delete path-m "delete test file" for example: 1. Delete the remote server file svn delete svn://192.168.1.1/pro/domain/test.php-m "delete test file" 2, delete the local file, then submit the svn delete test.php, and then svn ci-m "delete test file". It is recommended to use this abbreviation: svn (del, remove, rm) 8, svn log to view the log.

Svn log path for example: svn log test.php displays all changes to this file, as well as changes in the version number. Using this command in the root directory of the project may list a lot of log contents, so in order to find it easily, we usually use some additional parameters to match the use of the svn log command.

View log for a period of date svn log-r {2018-07-03}: {2018-07-09} shows a log list in a range of versions showing all log with jaspersong strings from r199687 to r199385 (described below by grep)

Svn log-r r103546:r104414 | grep-A2 jaspersong here explain the difference between the numbers after An in grep-A2 "jasper" |. Different numbers indicate the number of lines with different log version information displayed.

Check the list of files modified by a certain version and explain that this name is used more often.

Svn log-r r196674-v

Find all the modified svn log-v-- stop-on-copy $URL9 of the branch, and svn info path to view the file details.

For example, svn info test.php10 and svn diff path compare the modified file with the base version by default.

For example: svn diff test.php svn diff-r svn di11 n path (compare the difference between version m and version n) for example: svn diff-r 200 svn di11 201 test.php abbreviation: svn di11, svn merge-r MVA n pathLinux command line to merge the differences between the two versions into the current file.

Svn merge-r path n path for example: svn merge-r 200 svn merge 205 test.php (merges 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 svn helpLinux command line.

The commands that svn help ci is not commonly used are as follows: 13. Svn list path displays all files and directories in the path directory that belong to the version library.

Abbreviation: svn ls14, svn revert path the following two cases can be restored with the revert command.

(1) accidentally wrote a lot of things wrong and wanted to undo what was written (the changes have not been submitted to the server yet)

(2) accidentally delete the wrong file and want to restore the file (the deletion has not been submitted to the server) Note: this subcommand will not access the network and will resolve the conflict. However, it does not restore deleted directories. [it hasn't been practiced yet. I don't know what it means that the locally deleted directory will not be restored.]

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

Usage: svn resolved path Note: [this subcommand does not resolve conflicts or remove conflict tags according to syntax; it just removes conflict-related files so that path can submit them again. ]

16. Svn copy create Branch reference: https://www.cnblogs.com/huang0925/p/3254243.html https://blog.csdn.net/yangzhongxuan/article/details/7519948 https://blog.csdn.net/min954584739/article/details/78114273

Create a branch from the trunk.

Svn cp-m "create branch" http://svn_server/xxx_repository/trunk http://svn_server/xxx_repository/branches/br_feature001 acquires branches

Svn co http://svn_server/xxx_repository/branches/br_feature001 trunk merged into branch

Cd br_feature001 svn merge http://svn_server/xxx_repository/trunk branches merge into the trunk once the development on the branch is complete, the code on the branch needs to be merged into the trunk. This operation needs to be done in SVN under the working directory of trunk. The command is as follows:

Cd trunk svn merge-- reintegrate http://svn_server/xxx_repository/branches/br_feature00117, branch merging into trunk one to create branch

Svn copy http://example.com/repos/project/trunk http://example.com/repos/project/branches/beta merges the branch to the trunk on the branch to get the initial version number

Svn log-- stop-on-copy http://example.com/repos/project/branches/search_collect_1108 if you get the version number: 12461

On the branch, get the latest version number

Svn up, if you get the version number: 12767

Switch to the trunk and execute the following command (the following path is the path of the branch. )

Svn merge-r 12461 12767 http://example.com/repos/project/branches/search_collect_110818, merge a branch into the trunk, check to find the branch version method 1: enter the branch directory

Cd branch svn log-the last r11340 of stop-on-copy is the reversion when the branch is created

Method 2: enter the trunk directory

Cd trunk svn-Q-- stop-on-copy branch URL # this command queries for all changes on the branch since the branch was created, and the lowest version number is the version number we are looking for. Example: svn log-Q-- stop-on-copy svn://192.168.1.177/tags/beta_2009_12_24 merge into trunk command: svn-r branch version number: URL interpretation of HEAD branch: HEAD is the latest version on the current trunk

Example: cd trunk svn merge-r 12:HEAD svn://192.168.1.177/tags/beta_2009_12_24 what is the Linux system Linux is a free to use and freely spread UNIX-like operating system, is a POSIX-based multi-user, multi-tasking, multi-threading and multi-CPU operating system, using Linux to run major Unix tools, applications and network protocols.

On the Linux system in the most commonly used svn command refers to what is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can 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