456
技術社區[雲棲]
SVN的安裝以及配置,包括myeclipse的SVN插件安裝
安裝setup-subversion.msi
將bin目錄加到環境變量中
1.創建根目錄root存儲所有svn的工廠信息(每一個工廠等於一個項目)
2.手動啟動svn(關閉控製台即退出): svnserve -d -r f:/subversion/root
3.linux可以後台啟動svn,windows則需要配置服務:
sc create SVNServer binPath=+一個空格"F:\SubVersion\bin\svnserve --service -r F:\subversion\root"
然後在控製麵板的管理中的服務找到SVNServer,設置為自動啟動、則每次開機都會自啟動
(如果出現 錯誤1053 服務並未及時響應啟動或控製請求,則是因為沒有創建根目錄root導致)
安裝tortoiseSVN.msi
1創建工廠(配置人員)
svnadmin create f:/subversion/root/項目名稱
2配置權限
3在其他地方創建項目、目錄(項目經理)
創建項目提交到工廠。(安裝tortoiseSVN-1.7.6或者eclipse中的插件)
右鍵import中。url為工廠地址svn://localhost/項目名稱 (如果出現錯誤,則在項目的conf\svnserve.conf中設置anon-access=write匿名用戶可寫可讀)
4開發人員
通過右鍵的checkout。同步項目
安裝svn插件(myeclipse9)
1下載最新的SVN包
2、在你的磁盤上任意位置創建文件夾:“myplugins/svn”。名字可以任取,為了方便插件管理,建議名稱為“myplugins”。
3、將解壓的svn裏的兩個文件夾拷貝到“myplugins/svn”下。
4、複製下列java代碼,修改路徑並執行:
import java.io.File;import java.util.ArrayList;import java.util.List;/*** MyEclipse9 插件配置代碼生成器***/public class PluginConfigCreator{public PluginConfigCreator(){}public void print(String path){List<String> list = getFileList(path);if (list == null){return;}int length = list.size();for (int i = 0; i < length; i++){String result = "";String thePath = getFormatPath(getString(list.get(i)));File file = new File(thePath);if (file.isDirectory()){String fileName = file.getName();if (fileName.indexOf("_") < 0){print(thePath);continue;}String[] filenames = fileName.split("_");String filename1 = filenames[0];String filename2 = filenames[1];result = filename1 + "," + filename2 + ",file:/" + path + "/"+ fileName + "//,4,false";System.out.println(result);} else if (file.isFile()){String fileName = file.getName();if (fileName.indexOf("_") < 0){continue;}int last = fileName.lastIndexOf("_");// 最後一個下劃線的位置String filename1 = fileName.substring(0, last);String filename2 = fileName.substring(last + 1, fileName.length() - 4);result = filename1 + "," + filename2 + ",file:/" + path + "/"+ fileName + ",4,false";System.out.println(result);}}}public List<String> getFileList(String path){path = getFormatPath(path);path = path + "/";File filePath = new File(path);if (!filePath.isDirectory()){return null;}String[] filelist = filePath.list();List<String> filelistFilter = new ArrayList<String>();for (int i = 0; i < filelist.length; i++){String tempfilename = getFormatPath(path + filelist[i]);filelistFilter.add(tempfilename);}return filelistFilter;}public String getString(Object object){if (object == null){return "";}return String.valueOf(object);}public String getFormatPath(String path){path = path.replaceAll("////", "/");path = path.replaceAll("//", "/");return path;}public static void main(String[] args){/*你的插件的安裝目錄*/
//F:\\MyEclipse\\MyEclipse 9\\plugin\\svn
String plugin = "改成安裝目錄";new PluginConfigCreator().print(plugin);}}
5、找到“$myeclipse_home/configuration/org.eclipse.equinox.simpleconfigurator/”,打開其中的“bundles.inf”文件,為了防止分不清是不是我們自己後加的東西,在最後麵多回幾次車,然後粘貼第4步運行後的代碼,保存
6、重啟myeclipse
7、import工程,看看最下麵是不是多了一個“other”文件夾?沒錯,就是他了,我們的svn終於回來了!
值得一提的是:這種方法可以安裝任意一個插件,太爽了!
https://jsx112.iteye.com/blog/1167775
解決svn客戶端之間衝突的辦法:
1、修改代碼前先更新
2、各自負責自己的模塊
誤刪了一個文件並且提交。要恢複的辦法 是右鍵
恢複到特定版本update to revision,將文件添加到忽略列表,然後再添加到服務器
最後更新:2017-04-02 18:44:44