Use SVN in eclipse

Source: Internet
Author: User
Tags comparison svn

Overview

In our daily work, SVN is often used, and most of them are paired with Eclipse/myeclipse. This article focuses on some of the most long-used features of SVN in eclipse, including downloading and using SVN plugins, uploading code to the server, downloading code from the server, updating code from the server, and resolving code conflicts.

This article link: http://blog.csdn.net/v123411739/article/details/22512133


1. Download the Subclipse plugin in Eclipse (recommended method III) method One: Download the specific action from the Eclipse Marketplace : Open Eclipse----and help---Eclipse Marketplace--Enter Subclipse search in Find- --Find Subclipse Click Install


method Two: Download the specific action from the Install new software : Open Eclipse---help--Install NEW software--click the Add button and enter the download address: http:/ /subclipse.tigris.org/update_1.10.x, click OK



--After Subclipse and Svnkit are ticked, all the way next or agree to the end (here because I have installed, so next is gray)


method Three: Directly download subclipse zip file (recommended) specific operation: Baidu search subclipse-site-1.10.x (see which version you want to install)-- After decompression, locate the Dropins folder in the Eclipse directory, go to the Dropins folder and create a new folder named SVN, copy the features and plugins folders to the SVN directory--Restart eclipse


2. Upload project to SVN server

1. In eclipse, bring up the SVN repository view from Show view



2. Right-click in the empty location of the SVN repository window to select the new repository location



3. Fill in the address of the server



4. The repository import was successful and the imported repository appears in the SVN repository view



5. Create a new project, write the initial version of Project



6. Right-click Project---Team--Share project



7. Select repository Type SVN--click Next



8. Use an existing repository location, or create a new repository location



9. Use the project name as the folder name--click Finish--Enter your username and password (This step is not necessarily for everyone)



10. Freely choose whether to open the Synchronize view, it is recommended to open



11. Right-click Project--Team--Submit



12. Freely choose whether to write the log (recommended)



13. Click OK-to upload to the server successfully, at this time refresh the corresponding library, the repository appears under the uploaded project



3. Download project from server to local

1. In the Repository view, click the small triangle to the left of the library, and then all project under that repository (if you don't have a library, refer to create a new repository location, fill in the repository address)



2. Select Project to download right---check out as



3. Freely choose whether to change the properties (default is recommended)--Finish-Download Success



4. Updating code from the server 1. Right-click Project---Synchronize with resource pool


2. Select Open Synchronize View



3. Different server code with local code will be displayed in the Synchronize view, double-click a code file to see the comparison between the local code and the server code, plus the new file (not local)




4. Switch the mode to the incoming mode, the code in this mode is the server update code, need to download to local, right-click the file to be updated---Team--Update


5. If the symbol below appears, there is a conflict between the local code and the server code (that is, the local code has changed the code without updating to the latest version) or during the time you write code to A.java, someone uploads a new A.java code to the server, causing a conflict between the code, conflict, and then merge the code First .


5. Solutions to conflict situations Conflict Case 1: The server code is the same as the one where your code changes This is a complex situation where you can only save your own code locally, update the server code directly, and then modify your logic on the new code.
Conflict Case 2: The server code differs from the place where your code changes This is more common, you and other developers are changing the same file, but because the development tasks are separate, so the change is different, the workaround is as follows.
1. Double-click the conflicting file to enter the comparison view


2. Find the new but not local code block on the server, select the code block, click the button in the upper right corner (the button pointing to the arrow below) to copy the server code to local (also the same operation elsewhere), if the click button is useless, turn off the Compare view reopen


The following figure is a successful copy of the server code to the local code.



3. After copying the new code from all the servers to the local file, the right-click Conflict File selection is marked as merged, and the file disappears under the Synchronize view, and the file's code has successfully merged the local code and the remote code together



————— END —————



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.