1首先環境中確保svn 已經安裝 #svn –version
2 建立項目倉庫
[root@bZdceci5l local]# mkdir svn[root@bZdceci5l svn]# svnadmin create test //創建屬于這個項目的版本庫[root@bZdceci5l svn]# lltotal 4drwxr-xr-x 6 root root 4096 Feb 19 14:40 test[root@bZdceci5 svn]# cd test/[root@bZdceci5 test]# ll3 接著啟動服務 -d后臺運行 -r項目根目錄
[root@bZdceci5l test]# svnserve -dr /usr/local/svn/[root@bZdceci5l test]# ps -aux | grep svnroot 10637 0.0 0.0 112652 972 pts/0 S+ 14:49 0:00 grep --color=auto svnroot 22582 0.0 0.0 162184 896 ? Ss Feb06 0:00 svnserve -dr /usr/local/svn/4.為倉庫建立賬戶 進入版本庫配置目錄
[root@bZdceci5l test]# cd conf[root@bZdceci5l conf]# vim svnserve.conf 四行,前面的#號和空格去掉(注意去掉#要頂格寫,不要留有多余空格),變成anon-access = none (不允許匿名訪問)auth-access = write (允許寫入)passWord-db = passwd (訪問時需要輸入密碼)realm = test //改成自己的版本庫5.去分配賬號
[root@bZdceci5 conf]# vim authz [root@bZdceci5 conf]# vim passwd重啟svn[root@bZdceci5 conf]# svnserve -dr /usr/local/svn///linux 本地檢出[root@bZdceci5l test]# cd /home/wwwroot/PRoject/svn[root@bZdceci5l svn]# svn checkout svn://localhost/test6. windows 上檢出版本庫 
創建一個文件test1.txt 右擊添加后提交
7. //更新項目 [root@bZdceci5 ~]# cd /home/wwwroot/project/svn/test [root@bZdceci5 test]# svn up Updating ‘.’: A test1.txt Updated to revision 1. [root@bZdceci5lznff35dcosoddZ test]# ll total 8 -rw-r–r– 1 root root 5 Feb 19 15:23 test1.txt -rw-r–r– 1 root root 26 Feb 19 15:17 test.txt
8. 每次windows提交了 linux都要更新所以我們設置自動更新
#!bin/shexport LANG=en_US.UTF-8/usr/bin/svn update /home/wwwroot/project/svn/test --username root --password root//添加權限
[root@bZdceci5l hooks]# chmod -R 777 post-commit新聞熱點
疑難解答