A shared Git repository gives each contributor a local copy of the same project history. On the Linux desktop, Eclipse uses its EGit integration to clone a Git repository and bring the project into the workspace.
The clone lives in its own folder on disk. Eclipse adds the project from that checkout to the workspace, so the files you open in the IDE come from the local working tree. Import a project from a repository you trust, because Eclipse can run its configured builders when automatic building is enabled.
The branch you check out determines which version of the project you see. The branch must contain the Eclipse project descriptor, .project, for EGit to find it as an existing project.
Start with Project Explorer visible in Eclipse, with EGit installed and Git branch labels enabled. Have the anonymous HTTPS clone URL and the branch name for a repository with one Eclipse project at its root that is new to the workspace. The pictures use https://git.example.com/hello.git and the preview branch. If the Install Java 27 Support notice appears, you can choose whether to install it. Continue at step 1 with the workbench visible.
Steps to clone a Git project in Eclipse:
- Open File in the Eclipse menu bar.

- Choose Import… from the File menu.

- Expand Git in the Import dialog if the category is collapsed.

- Select Projects from Git under Git.

- Click Next > with Projects from Git selected.

- Select Clone URI on Select Repository Source.

- Click Next > with Clone URI selected.

- Enter the clone URL in URI, replacing any text already there.
EGit can fill URI from the clipboard. It fills in Host, Repository path, and Protocol from the URL. User and Password should stay blank for an anonymous clone. If Eclipse fills them from its saved credentials, stop here and don't click Next >.
- Click Next > on Source Git Repository to load the remote branches.

- Click Next > on Branch Selection with the branch you want checked.
Eclipse checks all branches by default. The checked branches are fetched, and the next page lets you choose which one to check out first.
- Set Directory to an empty folder, such as
/home/reader/Documents/hello.
- Open the Initial branch list on Local Destination.

- Select the branch you want to work on in Initial branch, such as
preview.
- Click Next > on Local Destination to clone the repository.
The clone has finished when the progress bar disappears and the project import options become available.
- Select Import existing Eclipse projects if another option is selected.

- Click Next > with Import existing Eclipse projects selected for the cloned Working Tree.

- Click Finish with your project checked under Projects.

- Confirm that Project Explorer lists your imported project with the chosen branch in its Git label.
Once the import dialog closes, the example row reads
hello [hello preview]. The square brackets contain the repository name and the checked-out branch.