Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set up Eclipse/EGit with GitHub?

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?

like image 937
john Avatar asked Apr 19 '11 23:04

john


People also ask

How does Eclipse sync code with GitHub?

Right-click on a project in the Package Explorer and select Team > Pull or right-click on a repository in the Git Repositories view and select Pull to pull new changes from the upstream branch your local branch is tracking.

How do I use EGit in Eclipse?

Open the Eclipse Import wizard (e.g. File => Import), select Git => Projects from Git and click Next. Select “URI” and click next. Now you will have to enter the repository's location and connection data. Entering the URI will automatically fill some fields.


1 Answers

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.

like image 129
Mohamed Mansour Avatar answered Sep 22 '22 16:09

Mohamed Mansour