How I have set up Github with Eclipse
Hello everyone,
I have a new installation of eclipse (Version: 2021-09 (4.21.0)) on my local PC. And I wrote my first Java code on it. But working without backup and versioning is dangerous, so I want to synch my project with Github.com.
There are several ways to achieve this goal, here I show what I did:
Precondition: Prepare SSH Key
On Github click on: Your account/Settings/SSH and GPG Keys:
I already had a ssh key, if you are interested to see how I did it, ask me, I have it in my private doku (# Create ssh key:) or follow the public Github docu.
So I already had an "id_rsa" file (with the private key) in my .ssh folder.
And also the default entry was set in Eclipse/Window/Preferences/General/Network Connections/SSH2:
Creating a new Java Project in Eclipse:
We start from scratch and create a new Java project:
Now we create in this project a java package:
Now let's create the first Java Class:
After creation, we put in some content:
We also can copy and paste classes from other packages (in my case I copied Event.java into the hamurabi package).
Short check, if it is running by pressing F11 (Yes it is):
So, now I have a local java project. The next thing is to synchronize it with Github.
Create a local and Github Repository
Ricghtclick on the project name and click on "Team/Share Project":
Now, we have a local Git Repository:
Now I click on Window/Perspective/open Perspective/Git:
Then I rightclick on the repository and choose "Commit":
In the right lower windows, We have to choose all the new files and add them to the index. After that, we have to type in a comment for the commit. Then let's commit and push:
I get asked for the remote destination. As it does not exist until now, we have to create it on Github:
Then we can take the URI. In my case I use the SSH URI, because I already have the SSH Keys implemented and it is much more convienent instead of typing in the password every time I push or pull:
And put it into the URI-Field:
(This is an old Screenshot. Please exchange "Test" with "Hamurabi")
After clicking on Preview it looks like this:
Now let's push:
Yeah - It has worked. The files have been pushed to Github:
Regards, Achim Mertens
Leave How I have set up Github with Eclipse to:
Read more #programming posts
Best Posts From Achim Mertens
We have not curated any of achimmertens's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Achim Mertens
- My Diary For Week 27
- My Diary For Week 26
- Mein IAM+PAM System auf dem Raspberry Pi
- My Diary For Week 25
- Wanderung zum Rothen Kreuz in der Eifel - Hiking in the Eifel (Germany)
- My Diary For Week 24
- My Diary For Week 24
- Backup und Restore meines Raspberry Pi mit Openclaw
- Openbao - ein Opensource Schlüsseltresor
- Mythen und Fakten zu Wärmepumpen
- My Diary For Week 22
- Sammelklage gegen Amazon
- My Diary For Week 20
- OpenClaw-, LLM Wiki- und Meilisearch-Erfahrungsbericht
- My Diary For Week 19
- My Diary For Week 17
- My Diary For Week 16
- My Diary For Week 15
- My Diary For Week 15
- Ansibel Schulung März 2026