avi
avi

Reputation: 1846

How to add project from git to eclipse?

I have an existed eclipse with project from Git in Computer A which is working.

I want to have another station in computer B.

I know that I should do Import -> Import from GIT as instructed here: https://www.lennu.net/import-git-project-into-eclipse/

But this is a project that no one has touched in a long time and I have no idea how to enter the data.

Is there a way to figure out the steps from computer A?

Upvotes: 0

Views: 84

Answers (2)

Gimby
Gimby

Reputation: 5274

If you have access to the Eclipse workspace on computer A, figuring out the git url can be done as follows. I can't see that machine, so this answer assumes its a standard Eclipse installation.

  1. Open the git perspective (window -> perspective -> open perspective)
  2. Make sure you're actually looking at the git perspective (should be a button in the top right of the workspace)

The git repositories listing should have an entry which is the git repository the project has been checked out from

  1. right click it, select properties
  2. under configuration you should see a property url which is the git URL the project was cloned from

And then its fingers crossed that you have access to that git repository so you can clone it out from computer B.

Upvotes: 1

Ala Eddine JEBALI
Ala Eddine JEBALI

Reputation: 7821

You have 3 options:

    1. Use Eclipse to import your project as you described in your question.
    1. Copy the project (all files / with hidden files) from computer A to computer B and it will work fine as all information GIT needs (history of commits, branches...etc.) are saved in a hidden folder .git. Then when you open your project with Eclipse in computer B, it'll know that it's a GIT project!
    1. Do you know your GIT repository URL? If yes, in your computer B, tape

      $> git clone <url/to/your/git/repository>

      Then when you open your project with Eclipse in computer B, it'll know that it's a GIT project!

Upvotes: 1

Related Questions