Eclipse uses Git to illustrate tutorials

Source: Internet
Author: User

Open Eclipse, click the menu Help--install New software ..., and the Install dialog box appears, as shown in:


Click the Add button, and the Add Repository dialog box appears, as shown in:


Enter the Git plugin's address http://download.eclipse.org/egit/updates/, enter the appropriate name for the plugin, click the OK button, and Eclipse will search based on this address, as shown below:

Then select the above two items and click Next to complete the installation. Restart eclipse after the installation is complete. Then click menu Help--about ADT and the following dialog will pop up:


Clicking on the install details will pop up the ADT Installation Details dialog box, as shown in:


In the Installed Software tab, we found that the Git plugin was successfully installed, and then the GIT account was configured:

Click menu Window--preferences--team--git--configuration

Click the Add Entry button which adds the user information:

The Key-value key value pair Here is the comment information when the code is submitted, where we can add information such as user name and mailbox.

Enter User.Name in key, then enter the username in value and click OK to add the user name of the user. Then click the Add Entry button again, add the user's email message, where key is written in User.email,key enter your mailbox name, click OK, at this time the user's mailbox information is added to complete. Of course, you can also add additional comment information. After the add is complete as shown:


Here we have the comment information when we submit the code to complete the configuration. Next, let's configure our local repository:

Select the items we want to back up in eclipse, then right-click--team--share Project ... This opens the Configure Git Repository dialog box, as follows:


Select the items we want to back up, then click Create ... button to select the local storage path for our project repository, which is the local repository. Click Finish. At this point our local warehouse is established. So when we modify how the project is submitted to the local repository, we just need to right-click--team--commit, then enter the comments of our commit code in the Open Commit Changes dialog, and select the file to be updated. The standalone Commit button completes the update of the locally modified file.


Next we configure the remote repository:

Select the items we want to back up, then right-click--team--remote--push ... Open the push to another Repository dialog box and add the URL of the repository that you created on GitHub in the URI, as follows:


Https://github.com/username/Test, where Test is the repository name you created, after you enter the URI, host and Repositorypath are automatically filled in, then enter your username and password below to click Next , the Git plugin will verify that your user name and password are correct and that the repository you have filled in is present, and if all validation is OK, the following screen will pop up:


Select your branch in this interface, select Master (Branch), and click on the Add Spec button, at this point, your remote repository is configured to complete and your project is uploaded to the repository you built on GitHub.

In the project development process, in addition to upload changes, but also need to update other people's code to the local, then we say how to clone the remote code to the Local:


1. Open the Git repositories window, click the menu window--show view--other...--Select Git--git repositories, and the Git repositories window opens, as shown in:

Clicking on the small button will pop up the Clone Git Repository dialog box, as shown in:


Fill in the URI with the repository path to the project you want to clone, your git account username and password, and click Next to clone the remote code to your local repository. Once you have completed your clone project in your local repository, then we just need to right-click Import Project into Eclipse.

At this point, Eclipse installs Git plug-ins, establishes local repository, connects remote repository, code commits, code updates, clone projects, and so on.

Eclipse uses Git to illustrate tutorials

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.