How to use github with eclipse.

We have been trying to use github with eclipse and have been totally failing. Does anyone know step by step instructions for getting started with github and eclipse? I keep finding partial instructions or old instructions that don’t match what things look like now. We just want to have a repository on Github where we can upload the current software each night and then be able to download it the next day, possibly on a different computer to continue working. I saw something somewhere that was specific to FRC that mentioned using relative paths so the user name wouldn’t be in the project files, but now I can’t find it. But it doesn’t matter, we haven’t gotten anywhere near to that step. Is there anyone that has gotten this to work?

Brian Utterback

Push: Adding locally hosted code to GitHub - GitHub Docs

Pull: Getting changes from a remote repository - GitHub Docs

Here’s an illustration of the workflow so you can get started.

Because I don’t understand what your specific problem is, this is all I can help you with.



So pull your repository to wherever, then in eclipse Import-> projects from eclipse -> local repos -> find the repo you want. Then, whenever you want to commit and push, go to terminal and type git commit -a (you may have to use git add [file names] first).

Brian, when you say “use github with eclipse,” are you looking for visual git integration within the IDE itself?

Git can be used without the IDE having any knowledge of its existence, but many IDEs offer functionality (built-in or through plugins) that make commits, diffs, resolving merge conflicts, etc potentially easier than using the standard command line interface.

Our team has used github and eclipse for the past three seasons.

This year we are trying out smartgit as ouour git client and so far I like it a lot.
In the past we have used egit, git command line, and the git GUI.

If there’s interest, I can make some videos outlining the installation and setup process using eclipse and smartgit, unfortunately I won’t be able to have them available until early next week.

I am well acquainted with revision control. I use mercurial in my day job, for instance. But so far I have not been able to get Eclipse and egit installed to the point that I can push or clone a repository on Github.

Aside from trying to get egit working, Atlassian SourceTree is an excellent visual git client that you might want to look at. GitHub has an official client for Mac and Windows as well but it’s less powerful.

Okay, I downloaded and installed Atlassian SourceTree. I presume that I use this separately, not from within Eclipse. Do you have an example to get me started. I think I have GIT set up okay. I have a project I created with RobotBuilder in Eclipse and a repository set up on Github. How do I bring them together?


Do you have an example to get me started. I think I have GIT set up okay. I have a project I created with RobotBuilder in Eclipse and a repository set up on Github. How do I bring them together?

Essentially what you need to do is initialize a new git repository in the directory where your project is located, and then add your repository on GitHub as a remote.

To do this in SourceTree, create a new repository and set the path to the directory where your project is located.

Then, choose Add Remote from the Repository menu and add the URL for your repo on GitHub.

+1 for SourceTree.

My only complaint with SourceTree (and an issue I have with all git clients) is that I haven’t found a good way to support multiple users on one machine. We have far more programmers than we have computers, so when students have to share computers they rarely end up using their own git account.

You could make different user accounts on the machine and each would have a unique git user attached to it.