参考:html
linux下安装SVN http://jingyan.baidu.com/article/3c343ff7039de20d37796306.htmllinux
svn客户端使用linux篇 http://jeanlyn.sinaapp.com/svn_linux/服务器
==================================app
svn使用简介svn
mkdir /home/svn_hl_gg/this
cd /home/svn_hl_gg/htm
svn checkout https://192.168.1.105/svn/gg/ .it
mkdir 22;io
cd 22;date
echo thisis22 >> 22.txt;
cd ..;
svn add 22;
svn commit -m "create 22 for gg";//执行这一步以后,代码才算真正上传到服务器了,这个时候管理者和其余组员能在仓库看见此代码。
4)修改代码并上传
vi 22.txt;
[root@localhost 22]# svn commit -m "added version2 for 22.txt"
Sending 22/22.txt
Transmitting file data .
Committed revision 4.
5)删除代码
[root@localhost 22]# svn del 22.txt
D 22.txt
[root@localhost 22]# ls
ls看到没有代码了,这个时候因为没有提交,服务器上仍是有的。可是这个时候用svn update就不能下载到本地了。想要取消操做,能够用svn revert。
[root@localhost 22]# svn revert 22.txt
Reverted '22.txt'
6) 提交删除
svn del 22.txt
[root@localhost 22]# svn commit -m "deleted 22.txt"
Deleting 22/22.txt
Committed revision 5.
这个时候代码服务器上的也删掉了。
7)下载更新:
假如其余组员又更新了代码仓库,添加了22n.txt这个文本。咱们能够直接在对应文件夹内使用svn update更新本地代码。
[root@localhost 22]# svn update
A 22n.txt
Updated to revision 6.
8)查看当前目录的修改历史:
[root@localhost 22]# svn log------------------------------------------------------------------------r6 | hl | 2016-05-28 09:09:09 -0700 (Sat, 28 May 2016) | 1 line22n------------------------------------------------------------------------r5 | hl | 2016-05-28 09:04:20 -0700 (Sat, 28 May 2016) | 1 linedeleted 22.txt------------------------------------------------------------------------r4 | hl | 2016-05-28 09:01:30 -0700 (Sat, 28 May 2016) | 1 lineadded version2 for 22.txt------------------------------------------------------------------------r3 | hl | 2016-05-28 08:18:23 -0700 (Sat, 28 May 2016) | 1 linecreate 22 for gg------------------------------------------------------------------------