How to create SVN branch directly in AS
- Download SVN plugin from File -> Settings -> plugins -> Marketplace -> "Subversion"
- Enable VCS in VCS tab if not already enabled
- VCS -> Browse VCS repository -> Browns SVN repository
- Right click the folder/repo you want to branch, click "Branch or Tag..."
- Select parent folder so that repos become siblings (or as you wish)
- Name the folder with ending -your-feature (or as you wish)
- Checkout your newly created branch
- Run to check if the branch works fine on its own (on linux/ios "chmod a+rx android/gradlew" might be necessary)
- Your commits will now only be to the current branch
How to merge SVN branch back to trunk/main repo
- Go back to your trunk/main repo (or check it out if you haven't already)
- VCS -> "Integrate project..."
- Change "Source 2" to the branch you want to merge from
- Resolve conflicts if any
- Commit changes to trunk
SVN switch branches
- Can be done using VCS -> "Update project..." -> Update/switch to another branch
- Or better still can be to just have one main/trunk project and one branch project
Reference
I personally did it slightly different than the official docs. But basically making a branch is just copying the folder as I understand it.
Merging on the other hand seems a little more complicated, as every reference of change has to be present. For instance deleting or moving a folder has to be a committed change, it can not just be done without a reference in SVN.
Also their way is to keep the main folders current name but making some subfolders name indicating that it is a branch.
- SVN intellij branching
- SVN intellij merging