First, why we need to use branching-merging. For example, there are two teams under Project demo, and SVN has a trunk version. Because of the sudden change in customer demand, resulting in the project needs to make a large change, at this time the team decided by the Group 1 to continue to complete the work of the original half of the "one module", the group 2 to develop new requirements. So at this point, we can set up a branch for group 2, the branch is actually a trunk version of "trunk" a copy version, but the branch is also a version control function, and is independent of the main line, of course, to the end we can through the "merging" function, the branch into the trunk, And eventually merge into one project.
The following is a detailed use of the Subeclipse plugin under Eclipse:
First build a project called Facebook
1. Create a branch, specify access to the new branch url:facebook3[note don't forget]
2. After establishing a good score, use the "toggle" function to switch to the branch for development.
I created a new fb3.html file and submitted it under the branch.
3. Switch back to trunk version "URL is Facebook version"
You will find that the trunk version does not appear in the fb3.html we just submitted, because fb3.html belongs to the branch, the next thing we want to do is "merge", by merging, we can merge the changes under the branch into the trunk version.
The following is the main configuration of the merge:
Start path: Trunk version of the path "if you need to merge the trunk version of the changes to the branch instead of"
Target path: Where to get the change "This is the branch path"
You can use the specified version number, where the latest revision is used.
4. Click on Merge and you will find a new file fb3.html
in the trunk version. This allows us to merge the changes made under the branch into the trunk version.
It is worth noting that:
1. It's a good idea to add a comment when creating a branch.
2. It is a good idea to ensure that two versions are clean before merging, "i.e. there are no uncommitted or conflicting files"
3. Target path when merging: whose URL needs to be incorporated into the other version.
The SVN command line output for the entire procedure is as follows:
- Copy-rhead Svn://192.168.1.192/placii/staggingarea/xiangqi/facebook svn://192.168.1.192/placii/staggingarea/ Xiangqi/facebook3
- Propset subclipse:tags "1538,facebook2,/facebook2,branch
- 1540,facebook3,/facebook3,branch "E:/myeclipse/workspace/facebook
- Switch SVN://192.168.1.192/PLACII/STAGGINGAREA/XIANGQI/FACEBOOK3 e:/myeclipse/workspace/facebook-rhead
- At revision 1541.
- Add-n E:\myeclipse\workspace\Facebook\WebRoot\FB3.html
- A e:/myeclipse/workspace/facebook/webroot/fb3.html
- Commit-m "" e:/myeclipse/workspace/facebook/webroot/fb3.html
- Adding e:/myeclipse/workspace/facebook/webroot/fb3.html
- Transmitting file Data ...
- Committed revision 1542.
- Switch Svn://192.168.1.192/placii/staggingarea/xiangqi/facebook e:/myeclipse/workspace/facebook-rhead
- D e:/myeclipse/workspace/facebook/webroot/fb3.html
- Updated to revision 1542.
- ===== File Statistics: =====
- Deleted:1
- Merge Svn://192.168.1.192/placii/staggingarea/xiangqi/[email protected] svn://192.168.1.192/placii/staggingarea/ Xiangqi/[email protected] E:/myeclipse/workspace/facebook
- A e:/myeclipse/workspace/facebook/webroot/fb3.html
- Merge Complete .
- ===== File Statistics: =====
- Added:1
- <span style="FONT-SIZE:12PX;" >copy-rhead Svn://192.168.1.192/placii/staggingarea/xiangqi/facebook svn://192.168.1.192/placii/ STAGGINGAREA/XIANGQI/FACEBOOK3
- Propset subclipse:tags "1538,facebook2,/facebook2,branch
- 1540,facebook3,/facebook3,branch "E:/myeclipse/workspace/facebook
- Switch SVN://192.168.1.192/PLACII/STAGGINGAREA/XIANGQI/FACEBOOK3 e:/myeclipse/workspace/facebook-rhead
- At revision 1541.
- Add-n E:\myeclipse\workspace\Facebook\WebRoot\FB3.html
- A e:/myeclipse/workspace/facebook/webroot/fb3.html
- Commit-m "" e:/myeclipse/workspace/facebook/webroot/fb3.html
- Adding e:/myeclipse/workspace/facebook/webroot/fb3.html
- Transmitting file Data ...
- Committed revision 1542.
- Switch Svn://192.168.1.192/placii/staggingarea/xiangqi/facebook e:/myeclipse/workspace/facebook-rhead
- D e:/myeclipse/workspace/facebook/webroot/fb3.html
- Updated to revision 1542.
- ===== File Statistics: =====
- Deleted:1
- Merge Svn://192.168.1.192/placii/staggingarea/xiangqi/[email protected] svn://192.168.1.192/placii/staggingarea/ Xiangqi/[email protected] E:/myeclipse/workspace/facebook
- A e:/myeclipse/workspace/facebook/webroot/fb3.html
- Merge complete .
- ===== File Statistics: =====
- Added:1
- </span>
I hope this article will be of some help.
Other references:
Http://www.iteye.com/wiki/subclipse/1626-subclipse-getting-started-guide-and-reference-c
=========================== about merging ==========================
When I merged, I found that the merged file was directly overwritten without the "conflict" that was supposed to occur, and later, after careful study, it was an operational problem.
Suppose my original project was placii, and the establishment of a branch was placiistore. Now you need to merge the branch Placiistore onto the main trunk. That configuration should
1. "Start path": The path of the branch is required here.
2. First revision number: The version number when the branch is established. Record the SVN console when you set up the branch
Mine is.
- copy -rhead svn://192.168.1.192/placii/trunk/ Code/server/source%20code/placii svn://192.168.1.192/placii/trunk/code/server/source%20code/placiistore
-
- 1549, Placiistore,/source%20code/placiistore,branch " e:/myeclipse/workspace/placii
- Span style= "FONT-SIZE:12PX;" >switch svn://192.168.1.192/placii/trunk/code/server/source code/placiistore e:/myeclipse/ Workspace/placii -rhead
- at revision 1550.
- <span style="FONT-SIZE:12PX;" >copy-rhead Svn://192.168.1.192/placii/trunk/code/server/source%20code/placii svn://192.168.1.192/placii/ Trunk/code/server/source%20code/placiistore
- Propset subclipse:tags "1527,placiistore,/source code/placiistore,branch
- 1549,placiistore,/source%20code/placiistore,branch "E:/myeclipse/workspace/placii
- Switch Svn://192.168.1.192/placii/trunk/code/server/source code/placiistore e:/myeclipse/workspace/placii-rhead
- At revision 1550. </span>
3. Destination path: Use the start path here.
4. Target version number: Use the latest version that is HEAD.
Click Merge and if someone makes a change on the main line version and you change the file on the branch, there will be a conflict. Then manually merge the conflicting code and right-mark it for resolution, which is what we have to do.
svn--Branch, Merge