Android Studio Config SVN server

Source: Internet
Author: User
Tags tortoisesvn

Original address: http://blog.csdn.net/jiangwei378376366/article/details/47104865

1. Install TORTOISESVN, recommend more than 1.8 version, the existing development environment we install TORTOISESVN client is the default installation, missing command line client, you can click the TortoiseSVN installation package to fill up the service, double-click the installation package >Next>Modify> Select command line client tools to install to local (the tools are not installed by default) > End installation:

2.Android Studio Client, select File>settings>version control>subversion>general, According to the configuration Svn.exe, if you do not install command line client tools, there are no Svn.exe files .



3.Android Studio client, as shown in, click Subversion,


Click "Plus" on the page shown, enter the SVN address of the code, OK, then you can retrieve the code you want, as shown in

_______________________________________________________________________________________________________________ ____________
Links: https://www.zhihu.com/question/32298079/answer/56010423

Second, the Android Studio project associated with the SVN repository and add ignore files
to create a new Android project in Android Studio, we will first add the files to be ignored and add the ignore files to the eclipse in Android studio. When we add ignore files on Eclipse, it's OK to add the Ignore file before the SVN is not associated with it (try to ignore the file successfully for many times). )。 Android Studio Add ignore file is also in Settings->version control (with versioning-related settings in this directory) under ignored files, click the plus sign to ignore the file settings, Android Studio defaults to three ways for developers to choose: Ignore the specified file, ignore all files under the folder, and ignore files that match the matching rules:
Click on the "+" button on the right to add, "-" Delete, Android studio created Android project generally need to ignore. Idea folder,. gradle folder, all Build folders, all. iml files and local.properties files.
After ignoring the file, we'll associate the project with SVN and choose Vcs->import into version Control->share project (Subversion); Here's a point, in the Import into version Control has import into Subversion and share project (Subversion) two options: The first is to directly import the project to the SVN server, but so the local project with the SVN server is not established association, After the import, all of the project's files will turn red, and you will be prompted to submit to the SVN server that the project is not a working copy of SVN, and the second is to associate the current project of Android Studio with the SVN server, but not to import the project onto the SVN server. The project needs to be submitted to the SVN server again after the connection is completed. Both ways can implement the ability to submit local code to the SVN server, but the steps are different, first to complete the second way of the project with the SVN Association and Code submission, the first kind of seemingly irregular, and then again; the second way to associate a local project with SVN:
you will then be prompted to select the SVN address and other options you want to share, such as:
under Define share target Select the second can be under the trunk to create your current project folder, the corresponding first option is to put the entire file directly under the Trunk folder, the third under the project folder has created a trunk folder, It is recommended to use the second method; Click Share when you are done, and the formatted version (JDK version) that lets you select the SVN working copy will pop up , such as:
recommended choice of 1.8format, I chose the other before the test, found that the project always reported a mistake, the reason is not found, so choose it first; Click OK to wait a while to create a local project associated with the SVN server, the successful regret automatically refresh the local project, the content of the project to become green means that has been Succeeded, as shown in:
So
far just the project with the SVN server, and did not submit the code to the SVN server up, how to submit it, it is very simple, just click on the SVN related action button in the commit (the second button on the left of the SVN related operation button);
after clicking Commit, Android Studio will parse the current code into code, if there is an error or warning will pop up the following box, if there is an error conflict, etc. need to be resolved before committing, if the warning can be ignored (same as Eclipse) , the first time the entire code is submitted to the SVN server is likely to be long, please wait patiently, and then create the project not so slow.
after the success we completed the new project with SVN and the link to the project to the SVN server.
The first way to do this is to remove the local code after importing the local code into the SVN server and then update the previously submitted code from the SVN server so that it can be developed with the SVN connection. The first approach differs from the second one in that the first is to commit the code to the SVN server before it is updated from the SVN server (the local project is connected to the SVN server), and the second is to contact the SVN server supervisor and then submit the code to the SVN server. It is recommended that you use the second method for SVN correlation of new projects.

Third, the Android Studio SVN code conflict Resolution
About the problem of code conflict resolution, first of all, thank you for your friend Shinchven's answer. When using SVN to update the code on the server, sometimes a code conflict dialog pops up asking if you want to merge, and offers three merging scenarios: Accept yours (using your), accept theirs (using others), and merge (merging);


The first two are all covered operations, there is not much to explain; When you choose Merge Merge, the Code Merge control window pops up, a total of three screens, the left and right sides when you and the server different code and highlight different parts, with arrows and fork number, By clicking on the arrows to add conflicting code to the middle of the merge area, click on the fork to identify the piece of code to discard, and after all the conflict processing is complete, merge succeeds.



Android Studio Config SVN server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.