Android Studio Config SVN

Source: Internet
Author: User

One, Android studio configuration svn
Android Studio Associated configuration svn is very simple, in Settings, find version control->subversion; in the Control Panel of this page, general in the command line Client tick, then browse the local SVN installation directory, select "Svn.exe";
There is also a use system default Subversion configuration directory under the Use command line client, which is checked by default, which is the path to the SVN-related configuration information. Leave the default path on the line, there is no need to modify anything at present, the above actions such as:

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, add the Ignore file in Android Studio and Eclipse, when we add the Ignore file on eclipse, However, in Android Studio it is only valid to add the Ignore file before the SVN is not associated (it has been tried many times to ignore the file ignored success!). )。 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 "There is no second option in Studio 1.3, only share project on Githup" : The first is to import the project directly onto the SVN server, but the local project does not have an association with the SVN server, all the files in the project will turn red after the import, and will be prompted to submit to the SVN server is not a working copy of SVN, the second is the Android The studio current project is associated with the SVN server, but does not import the project to the SVN server, and it needs to submit the project 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.

In my studio1.3 version there is no share project (subvision) can only choose to import the project directly to the server:

Add a server repository: Import the project to the server all the way to next! After the import is successful, the local project is good to associate with the server:

Slightly modify the next layout to see if the test is correlated:

To commit changes here are a few options to know:

Auto-update after commit: Automatic post-upgrade submission

Keep Files locked: Lock The file, I think this should be only you modify other developers can not change the function

Before you submit: before commit

Reformat code: Reformatting Codes

Rearrange code: Re-organize the codes

Optimize Imports: Optimizing Imports

Perform Code Analysis: Performing the profiling [default selection]

Check TODO (Show All): detects code that needs to be modified [show all default selections]

Clean up: Clears all

Update Copyright: Updating copyrights

Depending on the situation select the function point: for example, do not want others to modify the code can choose keep Files locked

Adding modification information to a commit message

Modification succeeded:

Under the Commit button, there is a create patch that has the option to try it out:

It should be understood that creating a patch file is a major function of seeing where the changes are made:

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.


of course, in the use of the process will certainly encounter a lot of problems above is also reference to other great gods, and also added a few differences: the time to continue to study the problem.
continue to improve:Checkout SVN on the project

Select Subversion

Import the project to the SVN server,

Import into Select Subversion

Click Add Service address for example

Browse the project folder on the SVN server

SVN repository will show file list

Other Notes

Single file check-in when file, right-click Subversion Add

File red: Indicates that the file was not added to the server

Green: Indicates that no new modifications have been updated to the server

Normal Black: Indicates synchronization with server

Folder Color Description

Reference: http://blog.csdn.net/niu_hao/article/details/6774471

yellow exclamation point (there is conflict):-This is a conflict, the conflict is that you have modified a file, others have modified the file, others to commit before you submit, then you will be prompted to submit the conflict, not allow you to submit, Prevent your submissions from overwriting other people's changes. To resolve the conflict, if you confirm that your changes are invalid, then use TSVN to restore your changes, if you think your changes are correct, the other person's submission is invalid, then use TSVN first labeled "Resolve Conflict", then you can submit; If you think your changes and other people's changes are part of the effective , you can manually merge other people's changes into your changes and then use TSVN to label "resolve conflicts" and then submit them. Go to the folder and look for files with a yellow exclamation point, which is where the conflict occurs, dealing with the conflict meter font size (with locally modified code):--This means you have uncommitted local code. Hello (newly added resources):--This indicates that the file is a new file resource in the project, the new resources can be files, pictures, code and so on.

The red exclamation point (the local code is not consistent with the library):--This means that the local code is not consistent with the library, and if the user wants to fix it, it can delete the red exclamation mark icon file and update it directly. Gray Rightwards Arrow (locally modified)--local code is not on the library in time. Blue left arrow (modified on SVN)--Remember to update the code and modify it before committing to the SVN comparison habit. Gray to the right and there is a plus arrow in the middle (local more than SVN files)--After the modification, remember to keep with SVN blue left and a plus arrow in the middle (svn more than the local file)-delete the file, updated again, the SVN file all updated. Gray to the right and a minus arrow in the middle (deleted locally, and SVN files not deleted)--that is, after you delete the confirmation, be sure to remember the library, with SVN consistent blue to the left and a minus sign in the middle of the arrow (SVN deleted, and the local not deleted files)--than the code on the SVN library, After you have determined that you need to delete, update svn (remove useless code). Red two-way arrows (modified on SVN, locally modified files)-This means that both local and SVN have been modified, preferably by merging local modifications to SVN, and then updating the code before modifying it.

File Status Description:

Single file check-in check-out operation: Right-click Subversion

Add, adding to the server

Commit: Submit

Update: Updated to get new version

Integrate: Merging

Note: SVN and VSS are different before checking in if a file is modified by someone else need to compare version how other modifications are valid require a merge check-in

Entire Project update submission: Commit, update

I don't know what it is. If you are just starting to choose Share Project (subvision), it seems that it is slow to choose commit, and it is not always possible to upload a green part of the code:

So I'm directly on the local: commit to the server inside

Android Studio Config SVN

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.