Linux SVN common commands in detail

1. Checkout the file to the local directory
svn checkout path
svn checkout https:
//192.168.1.00/etc/filelist svn co https: //192.168.1.00/etc/filelist
2. Add the file to svn
svn add file
svn add filelist.f
3. Submit the file to svn
svn commit -m “logmessage” path
svn ci -m “update” filelist.f
4. Update the file
svn update path
svn update -r XXXX filelist.f filelist.f file Back to XXXX version
svn info filelist.f View the current version of the file and the previous version
svn up -r 20235 Return the code to 20235 version
5,
delete a file svn delete file
svn delete filelist.f delete filelist.f file (only administrators have permission to delete under normal circumstances)
6, when the supplementary control svn co directory hierarchy
only directory
--depth = empty https://192.168.1.00/etc/filelist svn co
layer
svn co --depth = immediates https: //192.168.1.00/etc/filelist
all
svn co --depth = infinity https: //192.168.1.00/etc/filelist
generally use team project and will simultaneously hang branch, release, The directory structure of tags and trunk.
7. svn st
status: Display the status of directories and files in the working copy.
Common status is as follows:
M means modification.
C indicates conflict.
? Indicates that it is not included in version control.
! Indicates that the project has been lost locally.
8. Add, delete and submit files in batches
svn st | awk '{if ($ 1 == “?”) {Print $ 2}}' | xargs svn add
#svn status list? The file at the beginning indicates a file that has not been added to the repository

svn st | awk '{if ($ 1 == “!”) {print $ 2}}' | xargs svn rm
delete all the files in the svn library that need to be deleted at once (administrator rights)

svn ci -F comment.txt and
finally submit the revised file. -F indicates that the uploaded comments are read from the comment.txt file.

You can write the above three statements into a script, svn st yourpath.

9. Download a file
svn co xxx / xxx / filelist / filelist.f separately
URL xxx refers to a file, not a directory
using the following method:
svn co --depth = empty xxx / xxx / filelist filelist
cd filelist
svn up Filelist
can check out a file individually.

10. View svn log
svn log -l 5 View the 5 most recent logs of svn

Published 38 original articles · Like 29 · Visits 10,000+

Guess you like

Origin blog.csdn.net/weixin_45270982/article/details/104234032