Recently, a project was not convenient to Check locally and needed to be written and tested on the test server, so I studied how to use SVN in the Linux command line.

SVN help shows all the commands supported by SVN:

There are not many commands, and if you have used the Tortoise SVN client, it is not difficult to understand the meanings of these commands literally.

First I need to Checkout my project. The command used for this process is SVN checkout or SVN co

At the first prompt for password, the user name used to log in to the system will be used. Press Enter, you can enter your own user name and password, and then the whole download process will be completed.

Submit code

After modifying the code, you need to submit the code to the SVN. In this case, the SVN commit/SVN ci command is used. When submitting, it is best to use -m with comments so that you can view them easily in the future.

Update file

Every time you start coding, it’s a good idea to update your code to see if anyone else has changed it. The update command is SVN update/SVN up

You can switch to the directory that you want to update, directly execute SVN update without any specific file or directory, or specify the file or directory that you want to update.

See the log

This feature is especially useful when you find that your code has changed and you need to know what the changes are, as long as everyone has commented on each update.

Run the SVN log command:

[root@localhost config]# svn log config.php

————————————————————————

r79832 | shiqiang | 2010-06-29 11:16:35 +0800 (Tue, 29 Jun 2010) | 1 line

Change Config

————————————————————————

r76996 | shiqiang | 2010-06-22 13:51:33 +0800 (Tue, 22 Jun 2010) | 1 line

active $Id$s

 

Basically, SVN can work with these two common commands. However, SVN has very powerful functions. In terms of DIFF and Conflict processing, I have not studied how to solve it in Linux, as well as Tag and Branch functions. Using SVN can provide a very good tool for project management.