Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to merge branch with trunk using SVN in android studio

I would like to commit my changes in the branch and add those changes to the trunk version using the built-in svn tool in Android Studio. How can I do it?

Should I expect this kind of feature from this built-in tool or should I use an external tool like TurtoiseSVN?

like image 980
micnoy Avatar asked Jul 21 '13 11:07

micnoy


People also ask

What is the difference between trunk and branch in SVN?

A trunk in SVN is main development area, where major development happens. A branch in SVN is sub development area where parallel development on different functionalities happens. After completion of a functionality, a branch is usually merged back into trunk.


1 Answers

5 years later...

I am using Android Studio 3.1.5 and SVN.

To merge back a branch to its trunk:

  1. Switch to the trunk. In TortoiseSVN, it is easy to switch. Right click on your working copy -> TortoiseSVN -> Switch.
  2. You should see a dialog window like below. In To Path field, make sure that it points to your trunk folder. In Revision field, I always choose HEAD revision so I transfer everything from the branch to trunk. Click OK.

switch_dialog

  1. In Android Studio (AS), make sure that the switch worked. To verify, go to the task bar at the bottom of your AS. Click Version Control -> Subversion Working Copies Information -> Refresh. See if URL field points to your trunk.

taskbar_list

  1. Start the merging. Click Version Control -> Subversion Working Copies Information -> Merge From.... In the small pop-up window, select the branch you want to merge to trunk. It may also ask for which directory or file in the said branch you want to merge. Make the appropriate selection.
  2. In Select Merge Variant window, most of the time I select Merge All because that is usually the goal. Click OK.

merge_option

  1. Finally commit the newly merged changes.

NOTE: I prefer merging the trunk to my branch first. Resolve the conflicts in the branch, then finally, merge back to trunk.

like image 184
user1506104 Avatar answered Oct 05 '22 23:10

user1506104