How to merge branch with trunk using SVN in android studio

后端 未结 3 2164
轮回少年
轮回少年 2021-02-08 19:31

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 expec

3条回答
  •  忘了有多久
    2021-02-08 20:22

    How to create SVN branch directly in AS

    1. Download SVN plugin from File -> Settings -> plugins -> Marketplace -> "Subversion"
    2. Enable VCS in VCS tab if not already enabled
    3. VCS -> Browse VCS repository -> Browns SVN repository
    4. Right click the folder/repo you want to branch, click "Branch or Tag..."
    5. Select parent folder so that repos become siblings (or as you wish)
    6. Name the folder with ending -your-feature (or as you wish)
    7. Checkout your newly created branch
    8. Run to check if the branch works fine on its own (on linux/ios "chmod a+rx android/gradlew" might be necessary)
    9. Your commits will now only be to the current branch

    How to merge SVN branch back to trunk/main repo

    1. Go back to your trunk/main repo (or check it out if you haven't already)
    2. VCS -> "Integrate project..."
    3. Change "Source 2" to the branch you want to merge from
    4. Resolve conflicts if any
    5. 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

提交回复
热议问题