eclipse source control with github
Here is the simple, correct, up-to-date way to use Git + GitHub from Eclipse.
✅ Step 1: Install EGit Plugin (Usually Already Installed)
Most Eclipse versions already include EGit.
Check:
-
In Eclipse, go to
Help → About Eclipse IDE → Installation Details → Plug-ins -
Search for EGit.
If not present:
-
Go to Help → Eclipse Marketplace
-
Search EGit
-
Install it
-
Restart Eclipse
✅ Step 2: Connect Eclipse to Your Local Git Repository
Option A — You already have a project in Eclipse
You want to create a git repo for it.
-
Right-click the project → Team → Share Project
-
Select Git
-
Click Create Repository
-
Finish
Now your project is a Git repo.
✅ Step 3: Add GitHub as Remote
You need your GitHub repo URL.
Example:
https://github.com/username/projectname.git
In Eclipse:
-
Right-click your project → Team → Remote → Configure Push to Upstream
-
Enter:
-
URI: paste your GitHub URL
-
Authentication: GitHub username + PAT (personal access token)
-
-
Click Next, then select:
-
master/main → master/main
-
-
Finish
π GitHub Now Requires PAT (Not Password)
If you don’t have a PAT:
-
Go to github.com → Settings → Developer Settings → Personal Access Tokens → Fine-grained
-
Generate new token with:
-
repopermissions
-
-
Copy token → use it in Eclipse instead of password.
✅ Step 4: First Commit
-
Right-click project → Team → Commit
-
Select files → add commit message
-
Click Commit and Push
✅ Step 5: Daily Workflow
1️⃣ Pull latest
Right-click project → Team → Pull
2️⃣ Make your changes
3️⃣ Commit changes
Right-click → Team → Commit
4️⃣ Push to GitHub
Right-click → Team → Push to Upstream
π Additional Useful Views
Enable Git UI inside Eclipse:
-
Window → Show View → Other…
-
Expand Git:
-
Git Staging
-
Git Repositories
-
Git History
-
These give you full visibility like VS Code or GitKraken.
Comments
Post a Comment