in Eğitim

EGit plugin installation and Simple usage for Eclipse

This document describes the usage of EGit; an Eclipse plugin to use the distributed version control system Git. This tutorial is based on Eclipse 3.6 (Helios).

1. Overview

Git is a distributed version control system written in C. JGit is a library which implements the Git functionality in Java. EGit is an Eclipse Team provider for Git (using JGit) and makes Git available in the Eclipse IDE.

Git is initially used for Linux Kernel but then usage is spread out by lots of open source projects.(Android Source Code, Kernel, U-boot, X-loader, etc…)

2. EGit Installation

  • Begin the installation from the Eclipse Help menu item. Click Install New Software

  • A new screen will be opened, click Add button.

  • Fill the Name and Location fields as below.

  • After a few seconds, select “Eclipse Egit” and “Eclipse Jgit” at below screen and click Next.

  • Next screen shows items to be installed, click Next button.

  • Read the Licenses, accept them and click Finish button.

  • Finally, you should restart Eclipse for the installation changes to take effect. Click Restart Now button.

3. Clone Existing Project

1.  Adding Git Repository

EGit allows to clone an existing project. We will use U-boot as example.

  • Click Import under File menu.

  • Select Projects from Git then click Next.

  • Press Clone button and then at the opened window write your git repository URL.

  • You only have to paste the “git://git.denx.de/u-boot-arm” to the first line of the dialog, the rest will be filled out automatically. Then press Next.

  • After pressing next the system will allow you to import the existing branches. You should select at least “master”. Then press Next.

  • The next dialog allow you to specify where the project should be copied to and which branch should be initially selected. Then press Next.

  • You can configure Gerrit Code Review at below dialogue but at least now skip this step and press finish.

  • Wait the dialogue to finish the receiving objects.

  • Now adding repository using EGit is completed.

We can continue to creating a project due to repository or we can press Cancel to create project later.

2.   Creating Project with Repository

  • For importing projects select “Use the New Projects wizard” and press Finish. The next dialogue allow you to create new project due to repository source code.

  • Our example is based on C/C++ project. Select “Makefile Project with Existing Code” and press Next.

  • To complete creating project press Finish.

  • At the below screen, we see the U-boot-arm project that is created.

4. Using Egit

1.  Basic Operation

Once you have placed a project under version control you can start using team operations on your project. The team operations are available via right mouse click on your project. You can:

  • Select “Team” -> “Add”, on the project node to add all files to version control.
  • Select “Team” -> “Commit”, to commit your changes to the local Git repository.
  • Select “Team” -> “Branch” to create and to switch between branches.
  • Select “Team” -> “Push” to push your change to a remote Git repository (see the GitHub chapter).
  • “Team” -> “Tag” allows you to create and manage tags.

2.   Merge

EGit supports currently fast-forward merge. Fast-forward merge allows to add the changes of one branch into another if this branch has not been changed. Select “Team” -> “Merge” to perform this operation.

3.  View the resource history

  • Press “Show in History”.

  • At he below screen you will see a screenshot of the history.

Kemal OVER

Droidos Team

Related Posts

Written By:

Add a Comment

Your email address will not be published. Required fields are marked *