Common svn commands under Linux command line

  
 

Worked under ubuntu for nearly a year, and gradually became familiar with the command line operation. Recently, the company version control has also cut to git. Compared with the git and svn syntax, there are many similar

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

svn checkout path (path is the directory on the server)

Example: svn checkout https://svn.sinaapp.com/your_app_name

Abbreviation: svn co

2, add a new file to the repository under the Linux command line

svn add file

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

svn commit -m “test“

Example: svn commit -m “test“ test.php

Abbreviation: svn ci

4, Linux command line Lock/Unlock

svn lock -m “LockMessage“ [--force] PATH

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

svn unlock PATH

5, update to a version under the Linux command line

svn update - r m path

Example:

svn update If there is no directory afterwards, all files in the current directory and subdirectories are updated to the latest version by default.

svn update -r 200 test.php (restore the file test.php in the repository to version 200)

svn update test.php (update, sync in repository. If in When the submission is overdue, it is because of conflict, you need to update, modify the file, then clear svn resolved, and finally submit commit)

Abbreviation: svn up

6, under Linux command line View file or directory status

1)svn status path (the status of files and subdirectories under the directory, normal status is not displayed)

[?: not in the control of svn; M: content is Modify; C: conflict occurs; A: scheduled to join the repository; K: locked]

2) svn status -v path (display file and subdirectory status)

The first column remains Similarly, 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. The reason is that svn keeps the original copy of the local version in the local .svn.

Abbreviation: svn st

7, delete files under Linux command line

svn delete path -m “delete test fle“

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‘, It is recommended to use this

shorthand: svn (del, remove, rm)

8, view the log under the Linux command line

svn log path

:svn log test.php shows all the changes to this file, and the version number changes

9, view the file details under the Linux command line

svn info path

For example: svn info test.php

10, compare differences under Linux command line

svn diff path (compare modified files with basic version)

Example: svn Diff test.php

svn diff -rm:n path (comparison between version m and version n)

Example: svn diff -r 200:201 test.php

shorthand: svn di

Copyright © Windows knowledge All Rights Reserved