Use svn client in linux environment.
The client is svn command
[root@localhost ~]# svn --help usage: svn <subcommand> [options] [args] add blame (praise, annotate, ann) cat changelist (cl) checkout (co) # pull version, abbreviated co cleanup commit (ci) # submit, shorthand ci copy (cp) delete (del, remove, rm) diff (di) export help (?, h) import info list (ls) lock log merge mergeinfo mkdir move (mv, rename, ren) patch propdel (pdel, pd) propedit (PEDIT on) propget (pget, pg) proplist (plist, pl) propset (pset, ps) relocate resolve resolved revert status (stat, st) switch (sw) unlock update (up) # sync files from the server upgrade Subversion is a tool for version control. For additional information, see http://subversion.apache.org/
Pulling Code
Checkout svn svn: //192.168.134.174: / sadoc / svndata / --username = Test02 --password = 123456
svn code base address of the local address, create a directory in advance username and password
svn co svn: //192.168.134.174: / sadoc / svndata / --username = test02 --password = 123456
instruction shorthand
View echo, the following is done.
[root@localhost svndata]# svn checkout svn://192.168.134.174:/sadoc /svndata/ --username=test02 --password=123456 ----------------------------------------------------------------------- ATTENTION! Your password for authentication realm: <svn://192.168.134.174:3690> 934c0447-3ff6-4c11-a195-53e3e8f43666 can only be stored to disk unencrypted! You are advised to configure your system so that Subversion can store passwords encrypted, if possible. See the documentation for details. You can avoid future appearances of this warning by setting the value of the 'store-plaintext-passwords' option to either 'yes' or 'no' in '/root/.subversion/servers'. ----------------------------------------------------------------------- Store password unencrypted (yes/no)? yes A test02.txt Checked out revision 5. [root@localhost svndata]# ls test02.txt
If the svn server and client in a machine above. You can use the following url access (basic need).
[root @ localhost datatest] # PS -ef | grep svn # svn server and client machine above ? root 1204 1 0 11:08 00:00:00 / usr / bin / svnserve -d -r / application / svndata / the root 1234 11:26 PTS 1161 of 0/0 = 00:00:00 grep --color Auto the svn [root @ localhost datatest] # svn CO File: /// the Application / svndata / sadoc / / datatest / # password using the instructions do not have A test02.txt A test03.txt Checked out revision 6. [root@localhost datatest]# ls test02.txt test03.txt
Error handling:
If the data is data synchronization error occurs
svn: Can't convert string from 'UTF-8' to native encoding
Is a question of character sets, windows are supported by the Chinese. Linux installed when the system default does not support Chinese.
You can refer to:
https://www.cnblogs.com/zhaobolu/archive/2014/04/02/3641309.html
Modified ~ / .bashrc, was added export LC_ALL = en_US.UTF-8 export LANG = en_US.UTF-8 export LANGUAGE = en_US.UTF-8 then source ~/.bashrc
Then check the next locale
[svndata the root @ localhost] # the locale the LC_CTYPE = " the en_US.UTF-. 8 " # language used by the user symbols and classification the LC_NUMERIC = " the en_US.UTF-. 8 " # Digital the LC_TIME = " the en_US.UTF-. 8 " # Time Display format LC_COLLATE = " en_US.UTF-8 " # comparison and ordering habits LC_MONETARY = " en_US.UTF-8 " # currency unit LC_MESSAGES = " en_US.UTF-8 " # information is the main message, error messages, status information, title , labels, buttons and menus LC_PAPER = " the en_US.UTF-. 8 " #Default paper size LC_NAME = " the en_US.UTF-. 8 " # Name notation LC_ADDRESS = " the en_US.UTF-. 8 " # address notation LC_TELEPHONE = " the en_US.UTF-. 8 " # telephone number notation LC_MEASUREMENT = " the en_US.UTF -8 " # Measure expression LC_IDENTIFICATION = " the en_US.UTF-. 8 " # itself overview information comprises
Two of the more special
LANG # System Language
LC_ALL # If set, the value overrides all other locale settings
Synchronization Update
svn update / svndata /
local path
Look Echo
[root@localhost svndata]# svn update /svndata/ Updating '.': A test03.txt # A is to increase Updated to revision 6. [root@localhost svndata]# ls test02.txt test03.txt
View data
It can be used svn list
[root @ localhost svndata] # svn list / svndata /
local path
[root @ localhost svndata] # svn list svn: //192.168.134.174: / sadoc
remote library
[root @ localhost svndata] # svn list svn: //192.168. 134.174: / sadoc --verbose (show details)
submit data
Use command words. svn submission also need to add then commit the
Submit a single file
[svndata the root @ localhost] # Touch # {} A..D create several files [svndata the root @ localhost] # LS ABCD test02.txt test03.txt
[svndata the root @ localhost] # the svn the Add A # individual submissions
a a
[svndata the root @ localhost] # the svn CI # CI is the abbreviation for commit. Be sure to add -m parameter, submit written information. Without being given
svn: E205007: the Commit failed The (the Follow the Details):
svn: E205007: Could not use External Editor to FETCH log the Message; the Consider Setting at The $ SVN_EDITOR Environment variable or a using at The --message (-m) or --file (-F) Options
the svn: E205007: None of the SVN_EDITOR The Environment Variables, or the EDITOR are the VISUAL SET, and NO 'Editor-cmd' RUN WAS-Time Configuration Option found
[svndata the root @ localhost] # the svn CI -m "the Add A" # plus - m parameter to ok
Adding a
Transmitting the Data file.
Committed Revision 9.
[root @ localhost svndata] # svn List svn: //192.168.134.174: / sadoc # again, the documents have been submitted.
A
test02.txt
test03.txt
Batch submission
[root @ localhost svndata] # svn the Add * # file number, you can use *, but documents have been submitted, it will alarm svn: warning: W150002: ' / svndata / A ' IS already an under Version Control A b A c A d svn: warning: W150002: '/svndata/test02.txt' is already under version control svn: warning: W150002: '/svndata/test03.txt' is already under version control svn: E200009: Could not add all targets because some targets are already versioned svn: E200009: Illegal target for the requested operation [root@localhost svndata]# [root@localhost svndata]# [root@localhost svndata]# [root@localhost svndata]# svn commit -m "add files" # 再次提交 Adding b Adding c Adding d Transmitting file data ... Committed revision 10. [root @ localhost svndata] # svn List svn: //192.168.134.174: / sadoc # to view the repository, already in effect.
a b c d test02.txt test03.txt
Then we went to go see the windows, remote library information. We can also see the documents have been submitted.
Svn import local directory to the library
Import here, is not created in the library inside submissions. Instead, use the other path directory or file import into it.
[root @ localhost svndata] # mkdir -p / tmp / svn / Trunk / tmp / svn / Brunch / tmp / svn / logs # created three files similar to git the master, brunch, log directory
[root @ localhost svndata ] # Tree / tmp / svn /
/ tmp / svn /
├── Brunch
├── logs
└── Trunk
[root @ localhost svndata] # svn Import / tmp / svn / svn: //192.168.134.174: / sadoc - m "dirs the add new new" # import used for introduction, but also must be added -m parameter.
Adding / tmp / the svn / Brunch
Adding / tmp / the svn / Trunk
Adding / tmp / the svn / logs
the Committed Revision 11. The
[@ localhost svndata the root] # the svn List the svn: //192.168.134.174: / sadoc # Have a look at
A
b
Brunch /
c
d
logs /
test02.txt
test03.txt
Trunk /
Copy directory
It is to svn repository directory and copy it. With very little
[root @ localhost svndata] # svn List svn: //192.168.134.174: / sadoc # to view the current directory structure a b brunch/ c d logs/ test02.txt test03.txt trunk/
[root@localhost svndata]# svn copy svn://192.168.134.174:/sadoc/trunk svn://192.168.134.174:/sadoc/brunch/new_brunch_2019 -m "copy dir " # 使用copy指令,就是从哪复制到哪 ,也是必须要加上 -m 参数的 。
Committed revision 12.
[root@localhost svndata]# svn list svn://192.168.134.174:/sadoc/brunch/ # 再次查看,可以看到生效了
new_brunch_2019
然后我们去windows上面看 ,也可以看到目录结构。