Getting Started

Overview

If you're new to Git or distributed version control systems generally, then you might want to read Git for Eclipse Users first. If you need more details and background read the Git Community Book or Git Pro.

Basic Tutorial: Adding a project to version control

Configuration

Identifying yourself

Whenever the history of the repository is changed (technically, whenever a commit is created), Git keeps track of the user who created that commit. The identification consists of a name (typically a person's name) and an e-mail address. This information is stored in file ~/.gitconfig under dedicated keys.

EGit will ask you for this information when you create your first commit. By default, this dialog is shown only once until you create a new workspace or tick the checkbox "Show initial configuration dialog" on the Git Preference page:

You can also untick "Don't show this dialog again" if you want to see it again later.

Instead of using this dialog, you can always change this information using the Git configuration:

Setting up the Home Directory on Windows

Add the environment variable HOME to your environment variables.

  1. In Windows 7, type "environment" at the start menu
  2. Select "Edit environment variables for your account"
  3. Click the "New" button.
  4. Enter "HOME" in the name field
  5. Enter "%USERPROFILE%" or some other path in the value field.
  6. Click OK, and OK again. You have just added the Home directory on Windows.

EGit needs this path for looking up the user configuration (.gitconfig). HOME should point to your home directory e.g. C:\Users\Tom. Ensure correct case! E.g. C:\users instead of C:\Users may cause problems!

If the HOME variable is not defined the home directory will be calculated by concatenating HOMEDRIVE and HOMEPATH.

If both HOME and HOMEDRIVE are not defined HOMESHARE will be used.

EGit shows a warning if HOME is not defined explicitly. Keep in mind that if you set the HOME environment variable while Eclipse is running, you will still see following warning. You will have to restart Eclipse for it to recognize the HOME value.

Create Repository

Track Changes

/bin

Inspect History


Congratulations, you just have mastered your first project using Git !

Github Tutorial

Create Local Repository

Create Repository at GitHub

On the next screen you can see the URLs you may use to access your fresh new repository:

Eclipse SSH Configuration

Push Upstream


EGit Tutorial (EclipseCon March 2011)

You may want to learn how to work with EGit and Gerrit Code Review by going through the EGit tutorial we held at EclipseCon America 2011.

Installation and Configuration

This tutorial was developed using EGit 0.11 so you should use at least this version. Newer versions may provide an easier way to do certain steps, look at the EGit "New and Noteworthy" documentation.

Best you go through the exercises using the Gerrit-in-a-zip you may download from TODO. See exercise 9 to learn how to use that.

The egit-training repository is also available on http://egit.eclipse.org/. You may clone it from there using

git://egit.eclipse.org/egit-training.git

More details are given in

Exercises


EGit Tutorial (EclipseCon Europe Nov 2011)

We held this tutorial "Eclipse Hacker's Guide to the Git Universe" at EclipseCon Europe on Nov 2, 2011.

This tutorial was developed using EGit 1.2-SNAPSHOT so you should use at least this version. Newer versions may provide an easier way to do certain steps, look at the EGit "New and Noteworthy" documentation.

The egit-training repository is also available on http://egit.eclipse.org/. You may clone it from there using

git://egit.eclipse.org/egit-training.git

Exercises

Find slides and exercises here