Eclipse - Reconnect Git repository

By xngo on January 1, 2020

In my Eclipse environment, I'm able to pull, push and commit my project. However, when I opened my Git perspective, the git repository association is not under the Git Repositories tab. There are multiple ways to reconnect back your git repository link. Here they are.

Using add git repository icon

This is the simplest way to reconnect your git repository link. If you don't have the icon listed, use the import project steps described the next section.

  1. Open Git perspective.
  2. Under the Git Repositories, click on the Add an existing local Git Repository to this view icon.
    Eclipse - Git - Add an existing local Git Repository to this view icon
  3. Browse to the root directory of your project and add the git repository found under the search results.
    Eclipse - Git - Add found git repository

Using import projects

  1. Open Git perspective.
  2. Under the Git Repositories, right-click on an empty space and select Import Projects....
  3. Click on Show other specialized import wizards link to see all the other options.
    Eclipse - Git - Import Projects - Wizards
  4. Select Git > Projects from Git(with smart import).
  5. Select Existing local repository.
  6. Obviously, you can't select a git repository since it is not listed. Therefore, click on Add... button.
    Eclipse - Git - Import Projects - Add
  7. Browse to the root directory of your project and add the git repository found under the search results.
    Eclipse - Git - Add found git repository
  8. Follow the instructions.

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.