Build a GitHub development environment under Eclipse

Source: Internet
Author: User
Tags github ssh key

Since the strength of GitHub has been recognized by developers, more and more developers have chosen to use GitHub instead of SVN for development. I am no exception. I recently started to study how to use GitHub to host my code. Next I will introduce how to build a GitHub development environment under Eclipse.


1. Create your own GitHub account. The official website address is here and we will not discuss it much.


2. Install the EGIT component in Eclipse. Install EGIT components in two ways: Install NewSoftware in Eclipse and Install it in Marketplace in Eclipse. The second method is used as an example to describe how to install EGIT.


Search for "EGIT" in Marketplace and the page shown is displayed. Select "EGIT-Git Team Provider" and Install it.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/113423J26-0.png "title =" Git.1.png "/>

After EGIT is successfully installed, select Import in Eclipse resource manager. If the Git option is displayed in the Import dialog box, EGIT is successfully installed.


3. configure system environment variables


In System Properties, locate the environment variable and add the HOME variable. The value is % USERPROFILE %. As shown in:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/1134236256-1.png "title =" Git.2.png "/>

4. Create a GitHub library, and create your own GitHub library and HelloBoy on the GitHub website. As shown in:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/1134234N5-2.png "title =" Git.3.png "/>

5. Add the SSH key to your Git account.


Under Eclipse, select window-perferences, select Network Connections-SSH2 in General options, select the key management TAB, and select General RSA Key, as shown in:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/11342321b-3.png "title =" Git.4.png "/>

Add the generated SSH Key to the GitHub SSH Key. For example:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/11342364L-4.png "title =" Git.5.png "/>

Select Save Private Key in the Eclipse diagram above to Save the SSH Key generated in Eclipse.

6. Create a HelloBoy project under Eclipse. Connect to the GitHub account.

Create a HelloBoy Project and add a JSP or Java file. Select HelloBoy, select Team-Share Project, select Git in the displayed dialog box, and click "Next ". The following page is displayed:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/113423N56-5.png "title =" Git.6.png "/>

Select the Create button. In the displayed dialog box, replace uppercase letters in the path with lowercase letters. Otherwise, GitHub may not recognize them. I tried it multiple times and it only works in lower case. Select Finish.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/11342321X-6.png "title =" Git.7.png "/>

At this time, some HelloBoy projects will contain "?" This indicates that these projects are not synchronized with the GitHub local library. Here, select Team-Commit. In the displayed dialog box, select all files and click Commit. In this way, the code library is submitted to the local repository.


7. Local code library and remote code library Synchronization

Under the Git Resource Directory, select Team-Fetch to retrieve the directory on the GitHub network. As shown in:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/1134235442-7.png "title =" Git.8.png "/>

In the displayed window, copy the network URI of the project to and select "next ".

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/1134233204-8.png "title =" Git.9.png "/>

In the displayed window, select "Add All Branches Spec" and click Finish. The Fetch success dialog box is displayed.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/1134233C3-9.png "title =" Git.10.png "/>

Continue to the Git Resource Directory and select Team-merge. Because only after the two are synchronized can the local code be submitted to the network. Select "merge" here ".

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/1134235M8-10.png "title =" Git.11.png "/>

After the merge operation, the merge success dialog box is displayed. Select the HelloBoy project and select Team-Remote-Push. the dialog box shown in is displayed.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/11342343F-11.png "title =" Git.12.png "/>

Open the created HelloBoy library on the GitHub website, select SSH, and copy the URL to the URI shown in the figure above. Select "Next".


650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/1134235b3-12.png "title =" Git.13.png "/>

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/1134232P5-13.png "title =" Git.14.png "/>


In the dialog box that appears, select "Add All Branches Spec" and select "Next".


650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/1134234217-14.png "title =" Git.15.png "/>

The Push success dialog box is displayed. At this point, the GitHub environment has been set up successfully. You can repeat the above steps every time you submit code.




This article from the "dust wind with the shadows of the Sky" blog, please be sure to keep this source http://genuinecx.blog.51cto.com/2890523/1214687

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.