Eclipse IDE is widely used by Java and Android developers for its flexibility, plugin support, and integration with version control systems like Git. By connecting Eclipse to GitHub, you can easily manage commits, branches, and repositories — right from within the IDE.
In this guide, we’ll walk you through how to set up Git in Eclipse, connect your GitHub account, and push your first project step-by-step.
Prerequisites
Before we start, make sure you have:
- Eclipse IDE (2023 version or newer) installed
- A GitHub account
- Git for Windows installed (https://git-scm.com/download/win)
- A stable internet connection
Once these are ready, let’s begin.
Step 1: Verify Git Installation
Eclipse relies on Git to interact with GitHub. So first, check if Git is installed on your PC.
- Open Command Prompt or Windows Terminal.
- Type the following command:
git --version - If you see something like:
git version 2.xx.xGit is successfully installed.
If you get an error like ‘git’ is not recognized, download and install Git from the link above, then restart your PC.
Step 2: Configure Git Credentials
Before connecting GitHub to Eclipse, set your global username and email.
git config --global user.name "Your Name"
git config --global user.email "your_email@example.com"
These credentials identify you as the author of commits in GitHub.
Step 3: Open Your Project in Eclipse
- Launch Eclipse IDE.
- Open your Java or Android project (or create a new one).
- Confirm that the project builds and runs correctly before linking it to Git.
Step 4: Enable Git Support in Eclipse
To manage Git operations inside Eclipse, you’ll use the EGit plugin, which comes preinstalled in modern Eclipse versions.
- Right-click your project in Project Explorer.
- Choose Team → Share Project.
- Select Git and click Next.
- If prompted, choose:
- Create Repository (to initialize Git locally).
- Make sure your project folder is checked.
- Click Finish.
Your project now becomes a local Git repository, and Eclipse will track changes automatically.
Step 5: Create a New Repository on GitHub
Now, create a GitHub repository to store your Eclipse project online.
- Log in to https://github.com.
- Click the “+” icon in the top-right corner → New repository.
- Enter a repository name (same as your project name is recommended).
- Keep the repo Public or Private, depending on preference.
- Do NOT check Initialize with README (to avoid conflicts).
- Click Create repository.
You’ll now see a page with your remote repository URL, which looks like this:
https://github.com/yourusername/your-repo-name.git
Copy it — you’ll need it in the next step.
Step 6: Link Eclipse Project to Remote Repository
Now we’ll connect your local Git repository (in Eclipse) to the remote GitHub repository.
- In Eclipse, open the Git Repositories view:
- Go to Window → Show View → Other → Git → Git Repositories.
- Right-click your local repository → Remotes → Create Remote.
- Select origin as the remote name (default).
- Click Configure Push.
- In the URI field, paste your GitHub repository URL.
- Under Authentication, select one of the following:
- HTTPS: Enter your GitHub username and Personal Access Token (PAT) (required since passwords are no longer accepted).
- SSH: Use your SSH key if already configured.
- Click Save and Push.
Step 7: Commit Your Code
Before pushing code to GitHub, you need to commit your local changes.
- Right-click your project → Team → Commit.
- Select the files you want to include.
- Write a commit message (e.g., “Initial commit”).
- Click Commit and Push.
Eclipse will now upload your project to GitHub. If it’s your first time, you’ll be prompted for authentication (use your token).
Step 8: Verify the Upload on GitHub
After the push is complete, open your GitHub repository page in your browser.
You should now see all your project files uploaded.
Step 9: Pull and Push Future Changes
Once linked, you can manage all version control directly from Eclipse.
- To Push Changes:
Right-click project → Team → Push to Upstream. - To Pull Updates from GitHub:
Right-click project → Team → Pull.
Tip: Make sure you always pull the latest changes before committing new code to avoid conflicts.
Wrapping Up
Pushing your Eclipse project to GitHub helps you back up your work, collaborate efficiently, and maintain clean version control. Once your local repository is connected, you can manage commits, pushes, and pulls directly inside Eclipse — no command line needed.
By following this step-by-step guide, you’ve successfully linked Eclipse with GitHub and pushed your first project online. Now you can easily track progress, roll back changes, and contribute to open-source projects with confidence.