DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Shrink a Bloated Git Repository and Optimize Pack Files
  • Developer Git Commit Hygiene
  • A Comprehensive Guide to GitHub
  • Mastering Git

Trending

  • Ujorm3: A New Lightweight ORM for JavaBeans and Records
  • Detecting Bugs and Vulnerabilities in Java With SonarQube
  • When Snowflake Lies to You: Understanding False Failures in dbt Pipelines
  • Offline-First Patch Management for 10,000 Edge Nodes: A Practical Architecture That Scales
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Import Projects From Git Into Eclipse

Import Projects From Git Into Eclipse

In this article, see how to import projects from git into Eclipse.

By 
Erich Styger user avatar
Erich Styger
·
Updated Oct. 27, 23 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
48.5K Views

Join the DZone community and get the full member experience.

Join For Free

How to Import Projects From Git Into Eclipse?

  1. Click File> Import
  2.  In the Import Window, click Projects from Git (with smart import) and click Next.
  3. In the Select Repository Source Window, click Existing local repository or Clone URI.
  4. Step through the wizard and click Finish for the wizard to analyze the content for the project folder to find projects for import. Then import them into the IDE. The imported project will be listed in the Project Explorer view.

Import Projects From Git Into Eclipse

As a VCS (Version Control System) I’m using git in all my projects. And not only for software or firmware projects: I’m using it for hardware design (KiCAD, FreeCAD, …) or for documentation (LaTeX, …) too.

The nice thing with the Eclipse IDE is that it supports nice git integration, making importing projects from git repositories easy.

Import Projects from git


In this article I show how I can import projects into Eclipse from a git repository. This is useful if projects are hosted locally or if projects are hosted on a git provider like GitHub or GitLab. DZone’s previously covered how to deploy Spring Boot apps using Gitlab.

Related DZone Guide: CI/CD Tools Compared Jenkins vs GitLab.

Prerequisites

I assume that the following is installed:

  • Eclipse IDE, for example the NXP MCUXpresso IDE
  • git: https://git-scm.com/
  • SSH agent: OpenSSH (or use the agent which comes with the git installation)

Eclipse Git Perspective

Eclipse has a dedicated perspective for git:

Open Perspective


Open Git Perspective


In that perspective I have a list of repositories and can see the status and commit messages:

Repositories in Eclipse git Perspective


 While the Eclipse git perspective is great, I still prefer to have an external git client, and my preference is SourceTree.

Clone Git Repository

For Eclipse I need to have the git repository cloned/present on my machine. I can use normal git operations tools to clone the repository, or I can do this directly from Eclipse using the menu File > Import > Git: (both importers do the same)

File Import Projects from Git


It asks you if the import shall be from an already existing repository or if a repository shall be cloned first:

Select Repository Source


For an existing local repository I can select it from the list. If the desired local repository is not listed, it can be added using the ‘Add…’ button.

Select Git Repository


If the repository is not cloned yet, I can do this using the ‘Clone URI’ option and then provide the location of the git repository:

Source Git Repository


Once cloned, I can select the folder to be scanned for the projects:

Source Git Repository

Cloning a repository might take some time, depending on the size of the repository.

Import From Repository

In a next step I can select the folder of the projects I’m interested in:

Select project folder


Then it scans for existing projects and I can import a list of projects:

Import selected projects from git


Press Finish. With this, I have the project in the Project Explorer listed:

Imported project


One important and good thing is: it does not copy the projects into the workspace: instead it links to the projects which makes sense for projects under version control.

Summary

Importing projects from a git repository is a nice feature in Eclipse, and I can clone the repository as part of the process. Of course, if I have the repository already cloned, can use the MCUXpresso IDE drag & drop feature to import the project too. Beside of that, the built-in git Perspective is very useful too.

Happy git-ing :)

Links

  • git: https://git-scm.com/
  • NXP MCUXpresso IDE: https://mcuxpresso.nxp.com
  • SourceTree client: https://www.sourcetreeapp.com/
Git Eclipse Repository (version control)

Published at DZone with permission of Erich Styger. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Shrink a Bloated Git Repository and Optimize Pack Files
  • Developer Git Commit Hygiene
  • A Comprehensive Guide to GitHub
  • Mastering Git

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook