Eclipse using the Egit plugin to connect GitHub settings (a): Push article

Source: Internet
Author: User
Tags comments commit svn

Today, let's introduce the settings to connect to GitHub under Eclipse.

If you're using Eclipse with ADT downloaded from Google, it comes with the Egit plugin and does not need to be installed.

1, egit plug-in download and installation

First open Eclipse, and then click Help>install New Software.

Click Add to add an address Http://download.eclipse.org/egit/updates,OK.

Hook up eclipse Git Team Provider and then all the way next.

2. Configure Git

Click Window>preferences in Eclipse, then expand the Team>git option and click Configuration.

After adding Entry, add two more messages:

The user name on the User.name,github.

User.email,github bound email.

OK, complete the configuration.

3. Submit the code to the local warehouse file

Create a new Android project, then right-click on the project and choose Team>share Project.

Here we choose Git, and then next.

Here I choose to create a warehouse file in the previous layer file. If you choose to place a warehouse file somewhere else, just click Create on the right and choose a path.

Hook up with use or create repository in parent folder of project after the following interface appears.

Select the item, click the Create Repository button below, then click Finish. The local repository file is created.

Take a look at the project file that appeared on the. and >, which shows that our project is not yet a commit.

Next we commit the project file to the local repository.

Right-click on the item and Team>commit.

Then select the file we want to commit, and I've chosen all of them here. The comment must be written or not commit.

Click Commit and the file is submitted to the local repository file. Then take a look at our project.

Next we're going to submit the file to the GitHub website.

If you don't need to commit to GitHub and just want to do a local code management, here's the end.

4. Create a remote repository on GitHub.

First, you have to have an account and register an account on the GitHub website.

Then click on the New Repository button on the website

Enter a name for the warehouse, here we call Githubtest, then click Create Repository.

The path to the remote warehouse will appear after completion.

Copy this remote repository path, here we choose the HTTP way.

You can also choose the way ssh, but to get a key, more trouble, here is not selected.

We've created the remote repository and we're done.

5. Push the local file to the remote repository

Right-click on the item, Team>remote>push

Copy the address of the remote repository you just created, and fill in the username and password on GitHub.

Next, then select Add All Branches spec, then add spec, then click Next.

The result of the push will then be displayed, then finish, and then upload the dialog box that will jump out and click OK.

Then we're going to GitHub to see the code we've submitted.

Already, so we're done with the push content.

Next we modify the Mainactivity.java file, add a line of comments, save.

Then directly on the Mainactivity.java file right-click, Team>commit commits to local.

Write the comments, this time we click Commit and push to complete the local and remote commits.

The result after the completion.

6. Summary

GitHub is not like a previously used SVN or Microsoft TFS Tool. Either SVN or TFS is submitted directly to the remote server, but git commits the file to the local repository, and then synchronizes the local repository to the remote repository, one more layer in the middle.

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.