How do I set up Eclipse/EGit with GitHub?

144,726

Solution 1

Make sure your refs for pushing are correct. This tutorial is pretty great, right from the documentation:

http://wiki.eclipse.org/EGit/User_Guide#GitHub_Tutorial

You can clone directly from GitHub, you choose where you clone that repository. And when you import that repository to Eclipse, you choose what refspec to push into upstream.

Click on the Git Repository workspace view, and make sure your remote refs are valid. Make sure you are pointing to the right local branch and pushing to the correct remote branch.

Solution 2

In Eclipse, go to Help -> Install New Software -> Add -> Name: any name like egit; Location: http://download.eclipse.org/egit/updates -> Okay. Now Search for egit in Work with and select all the check boxes and press Next till finish.

File -> Import -> search Git and select "Projects from Git" -> Clone URI. In the URI, paste the HTTPS URL of the repository (the one with .git extension). -> Next ->It will show all the branches "Next" -> Local Destination "Next" -> "Import as a general project" -> Next till finish.

You can refer to this Youtube tutorial: https://www.youtube.com/watch?v=ptK9-CNms98

Solution 3

Install Mylyn connector for GitHub from this update site, it provides great integration: you can directly import your repositories using Import > Projects from Git > GitHub. You can set the default repository folder in Preferences > Git.

Share:
144,726
john
Author by

john

Updated on July 09, 2022

Comments

  • john
    john almost 2 years

    I've never used Git before and would like to learn.

    I have a private repository with GitHub.

    I've installed the EGit plugin for Eclipse.

    I have a workspace where I do my work, generally: ~/Documents/workspace.

    I am able to add my GitHub repository and download it, but in doing so it creates ~/MyRepository.

    When I create a project, do I need to point it to ~/MyRepository?

    Also, how come when I make an edit and I say push to upstream it says up to date?

  • KomodoDave
    KomodoDave over 11 years
    Can you import a private repo? I can't find a way.
  • Sturm
    Sturm almost 10 years
    Has the Mylyn connector been discontinued? The download links for it do not point to a valid location.
  • Jules
    Jules about 8 years
    Frankly that tutorial goes into way too much depth for a beginner user. I've been using git for years now, and don't understand half of the options it talks about. I can follow it up to pushing my repository into an empty github one, but when it comes to fetching remote changes I'm basically lost.
  • M.C.
    M.C. about 8 years
    For privat Repos: Window > Open Perspective > Git Repository Exploring and right click > Paste Repository Path
  • Clindo
    Clindo over 7 years
    This video tutorial helped me: youtube.com/watch?v=U1kXlahkwd4
  • nicomp
    nicomp over 6 years
    The link in this answer is broken.
  • ChenZhou
    ChenZhou over 6 years
    Thanks, I fixed it.