參考:
linux下安裝SVN http://jingyan.baidu.com/article/3c343ff7039de20d37796306.html
svn客戶端使用linux篇 http://jeanlyn.sinaapp.com/svn_linux/
==================================
svn使用簡介
1)創建目錄:
mkdir /home/svn_hl_gg/
cd /home/svn_hl_gg/
2)下載代碼:checkout
svn checkout https://192.168.1.105/svn/gg/ .
3)生成文件夾,提交代碼
mkdir 22;
cd 22;
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 line
22n
------------------------------------------------------------------------
r5 | hl | 2016-05-28 09:04:20 -0700 (Sat, 28 May 2016) | 1 line
deleted 22.txt
------------------------------------------------------------------------
r4 | hl | 2016-05-28 09:01:30 -0700 (Sat, 28 May 2016) | 1 line
added version2 for 22.txt
------------------------------------------------------------------------
r3 | hl | 2016-05-28 08:18:23 -0700 (Sat, 28 May 2016) | 1 line
create 22 for gg
------------------------------------------------------------------------