How to add a GitLab repository to Eclipse?

How to add Git-Lab to Eclipse?

So I can just click or get from GitLab. I am new to this, please give more explanation.

+19
git eclipse gitlab
source share
4 answers

I'm preparing

Make sure you have eGit in Eclipse:

  1. Help → Installation Details
  2. See what the "Eclipse Git Team Provider" is on the list.

If it is not installed, follow the directions in the answer from @VonC

Make sure you have the storage URL in GitLab. Something like https://gitlab.com/<someusername>/<somerepository> You get it from gitlab.com when you are on the project overview page:

  • Menu (hamburger icon ≡, 3 horizontal lines), → projects, then click on the one you want to work with from the eclipse. You are now on the overview page. Right under the name of the project and its description there are several buttons that allow you to perform some actions. One of these buttons is the selector for the SSH / HTTPS protocols. For now, select HTTPS and copy the following URL: this is the project URL.

II Now clone the repository locally using Eclipse eGit.

These steps have been tested at Eclipse Kepler and Eclipse Luna. Rumor has it that they are outdated and may not work as directed. If you are using a newer Eclipse, take care and post the new steps :-)

  1. Window → Open Perspective → Other
  2. Find "Git", select it and click "OK."
  3. Click the arrow button and the prompt "Clone the Git repository and add a clone to this view"
  4. In the "Source Git Repository" wizard:
    • URI: URL from the repository in GitLab, e.g. https://gitlab.com/<someusername>/<somerepository>
    • eGit populated the host and storage path for you.
    • Leave the connection unchanged (https and without port) and enter the authentication information: username and password that you use to log in to GitLab.com.
    • If you check "Store in Secure Store", Eclipse will now process your username / password; I do this, but it is not recommended if you share the installation of Eclipse with someone else or do not trust your PC to store their passwords.
    • Click "Next
  5. Branch selection wizard.
    • If there is more than one branch in the repository, now you can choose which one you want to clone locally, the one with which you want to interact. You can also clone all branches so that they are available.
    • When you're done, click Next.
  6. Local Destination Wizard.
    • Now you can choose where you want to host your local Git repository. By default, eGit is a subdirectory under your user, not related to eclipse, it works well. If you do not like it, change to your liking.
    • As with other Git installations, he will call the GitLab.com repository "origin". You can also change this if you really want to.
    • In the project window, select the "Import all projects" check box, and if you work with "Work Sets", you can choose which one to put it in.
    • Click Finish.

eGit now works a bit and shows you the recently cloned repository in a view. You have a cloned repository that you can interact with from Eclipse.

III Now import the project into Eclipse.

  1. File → Import ...
  2. Git → Projects from Git → Next
  3. Existing local repository -> Next
  4. Select a new cloned repository → Next
  5. Import using the Create Project Wizard → Done
  6. Select the type of project that is hosted on GitLab.com. In my case, it is "Java Project;" in other cases, it was "Maven → Maven Project". Then click Next.
  7. Name the project and change the necessary settings. Do not use the default location as the destination, but go to the location of the cloned repository (as used in step 6 in the previous section on repository cloning) → Next
  8. Make sure the import looks the way you want, and click Finish.

Now you can work in Eclipse and use the Team menu to synchronize, commit, and click.

+23
source share

The easiest way is to use Eclipse with EGit ( http://www.vogella.com/tutorials/EclipseGit/article.html )

See " Compare Eclipse packages " ( the Eclipse standard , for example, has EGit)

This will allow you to add the remote repo url referring to your gitlab repository server.
However, this does not apply to gitlab, and you can add remote repositories by referencing Github or Bitbucket.
http://wiki.eclipse.org/EGit/User_Guide#Working_with_remote_Repositories

http://wiki.eclipse.org/images/3/35/Egit-0.9-clone-wizard-url-page.png

+9
source share

There seems to be a Mylyn Gitlab Connector now .

I think I will try

+2
source share

Install Egit in eclipse by installing new software from http://download.eclipse.org/egit/updates .

+1
source share

All Articles