How can I merge code from branch to trunk?
I'm using subeclipse plugin for eclipse for SVN. My project looks like this :
ProjectName\
- branches - spec开发者_如何学运维ial_ - tags - trunkI have currently checked out project from special_
and I've modified and added one class, how can I merge the code which I updated/added to trunk
? I'll take anything into consideration
So you want to merge your change from special_
to trunk
? I believe you will want to proceed like this.
(Make sure that you have committed all of your changes to
special_
.)Team --> Switch to another branch/tag/revision...
your working copy totrunk
(the target of your merge operation), and resolve any conflicts that come up at this point.Team --> Merge
opens a dialog where you will be performing the merge operation. Change the "From" URL to referencespecial_
(the source of your merge operation, i.e. what you want to merge into your working copy). "From Revision" should point to the revision inspecial_
where you want your merge operation to "start" from - typically the revision that was last merged in fromspecial_
totrunk
(or perhaps the head revision in your case, if you really want to merge just that latest change of yours).Set "To Revision" to point to the latest revision in
special_
(= the head revision).At this point you are ready to perform the merge -
Dry run
command lets you preview what will happen during the merge, andMerge
will perform the actual merge.Once the merge operation has been completed, you need to make sure that all changes that were performed against your working copy are ok, and resolve all conflicts.
When you're done with resolving conflicts and reviewing the changes, commit the changes to
trunk
in a single commit operation. For your own convenience, it is strongly recommended that you add a commit message where you specifically state what this commit is for ( = merging revisions from X to Y fromspecial_
totrunk
, etc.).
Hope this helps.
First, if the class is in a new file, you should "svn add" it. This is a local change.
Then, you commit everything. Don't forget to review every file, and to get a peer review.
精彩评论