blob: e700b23b98498ba37dfec193ae206516b1acb698 [file] [log] [blame]
== Clone the example repository and import projects into Eclipse
Open the 'Git Repositories' view:
'Window > Show View > Other > Git > Git Repositories'
image:git-repositories-view.png[Git repositories view]
Click 'Clone a Git repository' in the git repositories view.
Enter the following URI in the URI field:
.for HTTP:
====
https://<your-user-id>@<gerrit-host>/training/sample
====
.for SSH:
====
ssh://<your-user-id>@<gerrit-host>:29418/training/sample
====
[NOTE]
For HTTP you need to enter a password for the authentication. +
For SSH leave the 'Password' field blank (an extra dialog comes up
if an SSH passphrase is required).
.Using the 'training/sample' repository from 'gerrit-review.googlesource.com':
[NOTE]
Please note that SSH is not enabled on
'gerrit-review.googlesource.com'. +
Cloning the repository over HTTP works without authentication.
image:clone-git-repository.png[Clone Git repository]
Click 'Next'.
If asked, accept the authenticity of the Gerrit host. You will have to
accept it only once, on the first access.
You should see some branch names in the next dialog. Make sure all shown
branches are selected:
image:branch-selection.png[Branch selection]
Click 'Next'. In the 'Directory' field, choose a path where to store the local
repository.
NOTE: The default path can be configured in 'Preferences > Team > Git' in the
field 'Default Repository folder'
Make sure the 'Import all existing projects after clone finishes' checkbox is
selected and click 'Finish':
image:finish-clone.png[Finish Git clone]
=== Get Familiar with the Example Project
The example repository contains two projects:
* 'org.eclipse.example.calc' - contains a simple calculator
* 'org.eclipse.example.calc.test' - contains unit tests
Both projects contain launch configurations. Use them to start the calculator
or run the unit tests.
NOTE: For Mac there is a specific launch configuration with the 'Mac' in the
name.
image:launch-sample-application.png[Launche Sample Application]
.The sample application:
image:sample-application.png[Sample Application]
=== Get Familiar with Eclispe EGit
==== EGit Documentation
The EGit user guide is bundled with the EGit feature, invoke it via 'Help > Help
Contents > EGit Documentation'.
==== Git Workbench Toolbar and Menu
In order to simplify usage of the most frequently used Git actions the Git
Command Group can be activated to show a Git Workbench Toolbar and/or Menu.
* go in the menu to 'Window' > 'Customize perspective...'
* in the tab 'Command Groups Availability' click 'Git', this will enable both
the Git workbench toolbar and menu
* in the tabs 'Toolbar Visibility and Menu Visibility' you may configure which
actions should appear in the Git Workbench toolbar and menu
image:git-workbench-toolbar-menu-1.png[]
image:git-workbench-toolbar-menu-2.png[]
==== Git Repositories View
To get an overview on your git repositories open the 'Git Repositories View'.
Select the example project and click 'Show in > Git Repositories'.
image:git-repositories-view-2.png[Git Repositories View]
Under 'Remotes > origin' you see the fetch and the just created push
configuration. To see the details select the URL and click in the context menu
on 'Properties'. To see the complete repository configuration, click
the same menu entry on the repository node.
image:repository-properties.png[Repository Properties]
==== History View
To browse the history of the repository, open the History View: On the
repository node in the Git Repositories View click 'Show In > History'
(Some views, e.g. in the Java EE-Perspective, do not have this
shortcut, in this case use 'Team > Show in History'). Best you
arrange the Repositories View and the History View next to each other,
as shown below.
image:history-view.png[History View]
link:index.html[Git Exercises]