本文章介紹基本的合併流程, 以Subclipse為例
在要合併的目錄, 可以由 Team --> 列出Subclipse所有功能
假設bdp是trunk project, bdp2是branch project
1.首先將新專案bdp2分支 Trunk > Branch
2.Branch開發到一半, 若要跟Trunk合併, 這時要選擇bdp2(也就是branch的project)按右鍵,
選Team -> 合併 ->
選擇 Merge a range of revisions
3.開發完成後, 要回主線 Trunk < Branch, 這時要選擇bdp(也就是trunk的project)按右鍵,
選Team -> 合併 ->
選擇 Reintegrate a branch
4.選擇要回去的branch的同階目錄(若從WebContent開始合併, 就指到branch的WebContent)
--
Subclipse圖示的解釋
(圖示出處: http://stackoverflow.com/questions/3917925/what-do-the-arrow-icons-in-subclipse-mean
Subclipse圖示的解釋
(圖示出處: http://stackoverflow.com/questions/3917925/what-do-the-arrow-icons-in-subclipse-mean
![Ignored File](http://i.stack.imgur.com/uKpNO.png)
![Unversioned File](http://i.stack.imgur.com/UWf9X.png)
![New File](http://i.stack.imgur.com/RMTXE.png)
![Deleted File](http://i.stack.imgur.com/NS1OG.png)
![Synchronized File](http://i.stack.imgur.com/iee2g.png)
![Local Changes](http://i.stack.imgur.com/jS8wu.png)
![Locked File](http://i.stack.imgur.com/kioVk.png)
![Needs Lock](http://i.stack.imgur.com/x6p5N.png)
svn:needs-lock
property is set, and Subversion will attempt to make these files read-only in the file system to enforce proper lock negotation.![Conflicted File](http://i.stack.imgur.com/HyV5B.png)
![Tree Conflicted File](http://i.stack.imgur.com/m3v8P.png)
![External File](http://i.stack.imgur.com/tIRZZ.png)
![Switched File](http://i.stack.imgur.com/QhHYs.png)
In a synchronization view (e.g. via Synchronize with Repository or Commit), as previously described, there are icons which indicate which direction a change is occurring in as well as additional information about that change. These are described below:
Outgoing
- A file whose contents have been modified and will be committed to the repository.
- A file that will be newly added to the repository. This may coincide with a file removal in cases where a file is moved or renamed..
- A file that will be removed from the repository. This may coincide with a file addition in cases where a file is moved or renamed.
- A file with property changes, in the Commit dialog. On the Synchronize tab, property changes are currently reflected as a normal file modification (
).
![Commit Changes](http://i.stack.imgur.com/BGt41.png)
![Commit Addition](http://i.stack.imgur.com/RO2hZ.png)
![Commit Removal](http://i.stack.imgur.com/01aZm.png)
![Property Change](http://i.stack.imgur.com/CeV6D.png)
![Commit Changes](http://i.stack.imgur.com/BGt41.png)
由合併的目錄, 會記錄合併後相關訊息(svn:mergeinfo)
以trunk合併branch情境來看
假設 trunk/WebContent merge branch/WebContent
原本上次合併是由 100 ~ 120, 目前最新版本是121, 合併後也會記錄一個版本, 所以會變成122, 那麼mergeinfo這檔案就是記錄100 ~ 122版本, 但重點是我們還沒有commit
所以此訊息會提示, 我們上次commit是100 ~ 120, 合併後版本變成 100 ~ 122, 它希望我們能commit這版本
為了要記錄這次合併的版本, 所做的提示(因為我們可能在下一階又commit其他變動)
Incoming
- A file that has content changes committed to the repository that will be applied to the local copy.
- A new file that will be added to the local copy from the repository. Like the outgoing file addition, this may be the result of a move or rename.
- A file that will be removed from the local copy because it has been removed from the repository. Like the outgoing file removal, this may be the result of a move or rename.
![Remote Changes](http://i.stack.imgur.com/3XXOX.png)
![Pull Addition](http://i.stack.imgur.com/PVH4L.png)
![Pull Removal](http://i.stack.imgur.com/OJme5.png)
Conflict
- A file that has been changed in both the local copy and repository independently, causing a need for conflict resolution. Fixing this condition involves opening up the conflict view or forcibly overwriting changes locally or remotely.
![Conflicting Versions](http://i.stack.imgur.com/9wrQQ.png)
![Synchronization Tree Conflict](http://i.stack.imgur.com/KwULa.png)
Finally, the Synchronize with Repository option opens the Synchronize tab (
) with the following buttons:
![Synchronize Tab](http://i.stack.imgur.com/lPBhk.png)
![Synchronize Source](http://i.stack.imgur.com/zY07z.png)
![Show Incoming](http://i.stack.imgur.com/Inal5.png)
![Show Outgoing](http://i.stack.imgur.com/PKM5L.png)
![Show Incoming and Outgoing](http://i.stack.imgur.com/bdp8P.png)
![Show Conflicts](http://i.stack.imgur.com/EyWVU.png)
![Update Incoming](http://i.stack.imgur.com/brjg1.png)
![Commit Outgoing](http://i.stack.imgur.com/e42Oa.png)
![Show Changesets](http://i.stack.imgur.com/nhsqV.png)
Conflict
Delete:只要是目錄有變動, 都算是
Add:
Edit:
Local:本機修改
Incoming:是别人修改, 你要Update或Merge進来
Tree Conflict
update情況
Local delete, incoming edit upon update
Local edit, incoming delete upon update
Local delete, incoming delete upon update (二邊都刪掉, 直接標記解決就行)
merge情況
Local missing, incoming edit upon merge
Local edit, incoming delete upon merge (當trunk合併branch, 若trunk修改此檔案, 但trunk刪除時)
Local add, incoming add upon merge (當branch回trunk, 若truck已有此檔案, 但trunk也新增)
Local edit, incoming delete upon update
Local delete, incoming delete upon update (二邊都刪掉, 直接標記解決就行)
merge情況
Local missing, incoming edit upon merge
Local edit, incoming delete upon merge (當trunk合併branch, 若trunk修改此檔案, 但trunk刪除時)
Local add, incoming add upon merge (當branch回trunk, 若truck已有此檔案, 但trunk也新增)