table of Contents
1. Integrated subclipse svn in Eclipse plug;
2. SVN server connected to the eclipse
3. Create a dynamic web project management using svn
4. Use svn plugin common operation;
A part of the file deleted items 4.3
5.2 The main project into branches (branch) on
6. The modified item branch and merge into the trunk;
First, when learning this one, must first have a basic SVN, see: https://blog.csdn.net/qq_40323256/article/details/90766301
1. Integrated subclipse svn in Eclipse plug;
Introduce one of the most error-prone installation: Click [help] - [] marketplaces, and then in the search box, enter: subclipse, click Find
How to determine whether subclipse successfully installed it? Click on [window] - [show view] - [other ...], in the pop-up dialog box, enter "SVN", if the following occurs, then the installation was successful!
2. SVN server connected to the eclipse
First double-click to open the "SVN Repository" ([window] - [show view] - [other ...] - [SVN] - "SVN Repository"), then right new repository location
Here we need to enter the URL, so let's create a project using SVN Management, and then copy the URL of the project here
3. Create a dynamic web project management using svn
Into the bin file in the installation directory of the SVN server folder, double-click VisualAVN Server.msc window to pop up VisualAVN Server
Create a new warehouse, right [Repositories] - [Create New Repository ...]
In the warehouse "shop" with the directory structure inside the new project, right [shop] - [New] - [project structure ...]
Then find a directory on the local, right-detected ( very important !! )
Then checked out:
然后复制URL:右键“shop”项目,点击copy URL to clipboard“”即可复制URL
然后回到eclipse中,输入刚刚复制的URL
然后eclipse中的项目就可以用SVN管理了,如下
比如现在新建一个动态web项目“shop”,将其用SVN管理起来
右键【shop项目】-【team】-【share project...】-【SVN】
然后可以看到项目变成了这样,左下角有一个星号
此时就可以让项目与资源库同步了,右键【shop项目】-【team】-【与资源库同步】,即可打开SVN同步窗口
然后就可以看到被SVN管理起来的项目了:
如果现在我们不想让SVN管理“shop”项目了,只需要在右键【shop项目】-【team】-【断开连接】
然后就可以看到shop项目变成了一个单机的项目了
如果此时我们不小心删除掉这个shop项目,我们还可以检出这个项目,找到SVN资源库,在项目根目录下右键【检出为...】
4.使用svn插件进行常用操作;
4.1 提交项目
比如现在给shop项目的user.java添加一个Integer类型的age属性后,要将其提交到SVN
右键【shop项目】-【team】-【与资源库同步】
提交后就成功地将更改部分保存到SVN中了,如下表示成功提交了
4.2 更新项目
在eclipse中右键【shop项目】-【team】-【与资源库同步】,然后在SVN同步窗口中右键【shop项目】-【更新】,即可更新项目
4.3 删除项目的某部分文件
先删除不要的文件,然后剩下的步骤同提交项目的步骤,即先与资源库同步,再提交
比如删除com.lijiang.web包,
删除成功
4.4 解决冲突
先更新,再保留合并后的代码(删除多余的注释和代码),再提交即可解决冲突
5.创建分支/标记;
5.1 将主干(trunk)项目放到tags中
一般我们开发项目是在trunk(主干)中,如果我们想要发布项目,就要把项目放在tags中
先在eclipse中右键【shop项目】-【team】-【分支/标记...】
5.2 将主干项目放到branches(分支)上
我们在开发新的功能或者做一些实验的时候,会建立一个分支(branches),在分支中写代码,完了之后再合并到主干中
首先右键【shop项目】-【team】-【分支/标记...】
如果shop项目在主干上,我们还可以将其切换到branches分支,右键【shop项目】-【team】-【切换】-【浏览】-【branches】
6. 修改分支项目,并合并到主干上;
首先要将修改后的分支代码进行提交,然后切换到主干项目,右键【team】-【更新】,再【team】-【合并】
然后就可以看到合并了,此时千万不要忘记提交主干项目!!