About the configuration and basic use of SVN in Android Studio in Windows, svnandroid

Source: Internet
Author: User
Tags svn client

About the configuration and basic use of SVN in Android Studio in Windows, svnandroid

I saw a lot of blog posts on the Internet about svn environment configuration and related Android-Studio, and found it very fragmented. I 'd like to gather the experts to sort it out:

In version control development in AndroidStudio, except Git is SVN, Android Studio does not provide separate plug-ins and can only be used in conjunction with the SVN client, which is very different from Eclipse installation, the following describes how to configure and use SVN in AndroidStudio.

If you have already set up the server, just import and checkout code in daily work, just download the TortoiseSVN client and skip the following steps:Create the SVN version Library (Repository ),Configure users and permissions.

I. SVN Installation

Download the latest software from TortoiseSVN, or find the corresponding software on the Subversion Chinese site.

My 64-bit system, installed TortoiseSVN-1.8.3.24901-x64-svn-1.8.4 version

After installation, find "path" in the system environment variable, and add "; C: \ Program Files \ TortoiseSVN \ bin" to the variable value (the quotation marks indicate the content to be added, of course, your path is definitely different from here. Remember the semicolon, which is separated from other values and must be added .). After the configuration is added, enter svn-version in cmd to test whether the configuration is successful.

Note: It is installed under C: \ Program Files \ by default.

 

The installation is complete. Start the command line and enter svn.

If the prompt is: 'svn 'is not an internal or external command, or a program or batch file that can be run.

You can solve the problem by using the following methods:

You can directly install the plug-in Eclipse. AndroidStudio does not work. You can only associate the SVN client. Note that the command line function must be installed when installing SVN, androidStudio can be used only when the SVN client with the command line function is installed. When installing SVN, You must select command line. By default, command line is not automatically installed, for example:

 

Select to install the command line function

 

 

Until the command line is started, enter svn

Tip: Use "svn help" for usage. Configuration complete.

2. Associate SVN in AndroidStudio

After installing SVN, open the settingS configuration panel in AndroidStudio and find Version Control --> SubVersion, for example:

 

Under the General tab, configure the SVN path. In the Use Command Line Client input box, Click Browse on the rightmost side. Select the svn.exe file path where TortoiseSVN is installed locally, for example:

Note: The svn.exe file icon is not a turtle. Do not read it wrong ···

Iii. simple use of SubVersion

1. Import and upload

Two methods:

One type: the CVS item in the top menu of AndroidStudio contains an Import into Version Control

 

Choose VCS> Import into Version Control> Share Project (Subversion );

Here, there are two options: Import into Subversion and Share Project (Subversion) under Import into Version Control.

[In studio 1.3, there is no second option. Only Share Project on GitHup]: The first option is to directly import the Project to the SVN server, however, if the local project is not associated with the SVN server, all the files in the project will become red after the import, when submitting to the SVN server, the system will prompt that the project is not a working copy under SVN;

The second is to associate the current project of Android Studio with the SVN server, but the project is not imported to the SVN server. After the connection is established, submit the project to the SVN server again.

Both methods can be used to submit local code to the SVN server, but the steps are different. First, complete the association and code submission of the second method of project with SVN, the first type seems informal;

The second method is to associate a local project with SVN:

The SVN address to be shared and other options will pop up, such:

Under Define share target, select the second one. After the selection is complete, click Share to display the formatted version (jdk version) of the SVN work copy that you select. For example:

We recommend that you select 1.8 format. I tried other methods and found that the project always reports an error. The cause is not found for the moment. Let's select this first; click OK and wait for a while to create a local project associated with the SVN server. If the project is successfully refreshed, the local project is successfully refreshed. If the content in the project turns green, the project is successfully refreshed. So far, I have only established a connection with the SVN server, and have not submitted the code to the SVN server. How can I submit the code and continue ····

Type 2: In the project folder, right-click the project and choose TortoiseSVN> Import> OK. You can add and update log Content ···

 

2. Check out the items in the version Library

First:

Select a blank area or create an empty folder, right-click the folder, select SVN Checkout, and click OK.

Second:

In the top menu of AndroidStudio, the CVS item contains a checkout from version control-Subversion. Click the pop-up checkout from Subversion dialog box.

 

 

Click + to add the repos url path. The checkout button can be downloaded Based on the selected path. The permission authentication input dialog box is displayed, and OK. Select the target path.

Note: The account and password are assigned to you by the server.

 

 

At this point, we pulled it down.

 

Q: The SVN file Cannot checkout from svn: Server SSL certificate rejected Cannot be exported or the error code is returned.Svn:E170001, svn: E175002

A: The problem is causedSvnBecause the account name and password have no permissions, this problem occurs because the svn certificate cache is configured.

Solution 1: On the setting-> Version Control-> Subversion-> General tab of AndroidStudio, click the Clear Auth Cache button below to Clear the certificate Cache, after that, you only need to enter the svn user name and password to associate the project again.

Method 2: In the project directory, right-click TortoiseSvn> setings> saved Data> Authentication and click Clean all.

 

I wrote a blog on the first day and found that it was really not easy to write something.

We would like to thank the bloggers at http://www.cnblogs.com/songmeng/p/4389446.html.

 

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.