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.

If there you are coming from CVS, you can find common CVS workflows for Git Platform-releng/Git Workflows.

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


EclipseCon 2012 Git Tutorial

Find all exercises and the slides here.

Follow the exercise #1 to prepare for the Git Tutorial. Find download links to the training packages below.

EGit Training Packages

Pre-installed EGit training packages including

Linux

[http://download.eclipse.org/egit/training/eclipse-SDK-3.7.2-linux-gtk-x86_64.tar.gz eclipse-SDK-3.7.2-linux-gtk-x86_64.tar.gz] 
[http://download.eclipse.org/egit/training/eclipse-SDK-3.7.2-linux-gtk.tar.gz eclipse-SDK-3.7.2-linux-gtk.tar.gz]

Mac

[http://download.eclipse.org/egit/training/eclipse-SDK-3.7.2-macosx-cocoa-x86_64.tar.gz eclipse-SDK-3.7.2-macosx-cocoa-x86_64.tar.gz ]
[http://download.eclipse.org/egit/training/eclipse-SDK-3.7.2-macosx-cocoa.tar.gz eclipse-SDK-3.7.2-macosx-cocoa.tar.gz]

Windows

[http://download.eclipse.org/egit/training/eclipse-SDK-3.7.2-win32-x86_64.zip eclipse-SDK-3.7.2-win32-x86_64.zip]
[http://download.eclipse.org/egit/training/eclipse-SDK-3.7.2-win32.zip eclipse-SDK-3.7.2-win32.zip]