Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating Eclipse and GitHub

Tags:

github

eclipse

I am in need of help in trying to setup Eclipse so that I can push my code onto my GitHub account. I've searched online and the tutorials I have found are either outdated or don't work for me.

I already have a project on Eclipse. How would I put that code onto GitHub? Would someone please add detailed instructions please. Any help is appreciated.

EDIT As soon as I posted this question, and fiddling around with the settings I managed to get it to work! What a coincidence...

The only problem I have now is how do I set it up so that when I commit it will only select the files in the project folder? Right now it is showing all 600 files in the Package Explorer.

enter image description here

like image 406
Quaxton Hale Avatar asked Jan 31 '14 05:01

Quaxton Hale


People also ask

How do I link my Eclipse project to GitHub?

With your project open in Eclipse, right-click the project name in Project Explorer and select Team, Share Project... Select Git and select Next. Select Create... from the Configure Git Repository window and choose a folder for your local Git repo. Select Finish.

Can we connect Git with Eclipse?

The Eclipse IDE provides support for the Git version control system. You can easily perform the necessary Git commands like staging, commit, merge, pull and push via the Eclipse IDE. Git is pre-installed in Eclipse IDE. If git is not installed by default, go to Help > Eclipse Marketplace and install git explicitly.

Does GitHub desktop work with Eclipse?

Github desktop does not support Eclipse. They support 18 IDEs other than VS code on windows. You can view the list with links to each IDE in the Github docs. You are able to edit the clone in Eclipse then the changes will show up in GH destop.


1 Answers

Alright, there are several ways of doing this. I found this to be the easiest way:

First, set up SSH2 configurations. Go to Windows->Preferences->General->Network Connections->SSH2->Key Management and Generate RSA Key. Save Key

Copy that key. You will need to go to your GitHub account settings and add the new SSH key to your account.

Now, you need to install eGit:

enter image description here

enter image description here

Next, you want to add the Git Repositories view:

enter image description here

enter image description here

enter image description here

Create a new Git Repository. I have already created a repository called Java. I will refer to that repo for the rest of the explanation.

enter image description here

After you create your repository, it should show up in the Git Repositories view. Now to add your project to the repository, right click on your project and select Team->Share Project.

Select the repository you just created. You can also use CTRL+ to select multiple projects and place them in one repository.

Now go back to your Git Repositories view. Go to Remotes . Right click and select Create Remote.

enter image description here

Select Change... and enter the SSH link for your Repository on GitHub. For connection, select SSH. Then press Finish. enter image description here For Rev-mapping, select Advanced.... For Source Ref select refs/heads/master. And then press Add Spec, then select Save specifications in 'origin' configuration. Then press finish. That's pretty much it. You can commit changes by right clicking your project - >Team->Commit...`

enter image description here

Push new commits to GitHub:

enter image description here

This is a really good explanation on how to set up Eclipse pull requests.

The current branch is not configured for pull No value for key branch.master.merge found in configuration

like image 193
Quaxton Hale Avatar answered Oct 20 '22 11:10

Quaxton Hale