EGit is the Eclipse Git integration: a set of OSGi bundles built with Maven and Tycho on top of the JGit library.
Build with JDK 25 (the BREE is JavaSE-25); JGit's build fails on newer JDKs.
EGit resolves JGit from a locally built p2 repository at ../../jgit/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/target/repository (the jgit-site property in pom.xml), so JGit has to be built first in a sibling checkout whose version matches the Require-Bundle/Import-Package range in EGit's manifests:
cd ../../jgit && mvn clean install -DskipTests
cd org.eclipse.jgit.packaging && mvn clean install -DskipTests # separate reactorFull EGit build from the repo root:
mvn clean verify -DskipTests- The target platform is picked with
-Dtarget-platform=egit-4.xx; the files live inorg.eclipse.egit.target(.tpdsources, generated.targetfiles). -Pstatic-checksadds SpotBugs and PMD (spotbugs-excludes.xml).- Pass
-Dtycho.baseline.replace=noneon local builds, otherwise Tycho may swap the freshly built jar for the published baseline jar. - The code formatter profile is
tools/eclipse-JGit-Format.xml.
org.eclipse.egit.ui.test holds SWTBot tests; only classes matching **/*Test.java are executed.
Shared test utilities live in org.eclipse.egit.core.junit.
Run a single test class by putting the test bundle and every in-repo bundle it depends on into the reactor; bundles left out are resolved from the target platform or ~/.m2 and the test runs against stale code.
org.eclipse.egit.ui.test depends on the EGit and gitflow features, so those must be in the reactor too, together with -Dtycho.localArtifacts=ignore:
# core
mvn verify -pl org.eclipse.egit,org.eclipse.egit.core,org.eclipse.egit.core.junit,org.eclipse.egit.core.test \
-Dtest=IndexDiffCacheTest -DfailIfNoTests=false \
-Dtycho.baseline.replace=none -Dtycho.localArtifacts=ignore
# UI, headless on Linux
env -u WAYLAND_DISPLAY -u XDG_SESSION_TYPE GDK_BACKEND=x11 xvfb-run -a mvn verify \
-pl org.eclipse.egit,org.eclipse.egit.core,org.eclipse.egit.ui,org.eclipse.egit.doc,org.eclipse.egit-feature,org.eclipse.egit.gitflow,org.eclipse.egit.gitflow.ui,org.eclipse.egit.gitflow-feature,org.eclipse.egit.core.junit,org.eclipse.egit.ui.test \
-Dtest=<TestClass> -DfailIfNoTests=false \
-Dtycho.baseline.replace=none -Dtycho.localArtifacts=ignoreTycho needs mvn verify, not mvn test.
org.eclipse.egit.corewraps JGit for the Eclipse workspace and has no UI dependencies. It provides the Team provider (GitProvider), the mapping of workspace projects to repositories (RepositoryCache,RepositoryUtil,internal/project), long running Git operations asIEGitOperations inop/, and the index diff cache (internal/indexdiff) that incrementally tracks working tree status from resource deltas and feeds decorators and the Staging view.org.eclipse.egit.uibuilds all UI on top of core.org.eclipse.egit.gitflowandorg.eclipse.egit.gitflow.uiare an optional core/UI pair for the gitflow branching model.
Conventions that span several files:
- Background services are OSGi Declarative Services components (for example
ExternalRepositoryScanner,AutoFetchComponent). TheirOSGI-INF/*.xmldescriptors are checked in and not regenerated by the build, so a new or changed@Componentneeds its XML written by hand and listed in theService-Componentheader ofMANIFEST.MF. - User visible strings use Eclipse NLS: fields in
UIText/CoreTextmust match keys inuitext.properties/coretext.properties. - UI preference keys live in
UIPreferences, their defaults inPluginPreferenceInitializer; core preferences inGitCorePreferences/GitCorePreferenceInitializer. - Job families used by tests to join jobs are declared in
JobFamilies(core and UI each have one). - Javadoc is concise: one or two sentences on what the class or method does, without implementation details, issue links or change history, and without
@param/@returntags that only repeat the name. - Almost everything is in
internalpackages; keep new API out of exported packages unless it is meant to be API, since versions follow OSGi semantic versioning.
Changes are reviewed on Gerrit (GerritHub), not via GitHub pull requests, which cannot be merged.
Commits need a Change-Id from the Gerrit commit-msg hook and an Eclipse Contributor Agreement signature; each review is a single commit, updated by amending it.
Keep the commit message concise: a short imperative subject line and a body of a few sentences saying what changed and why, without an implementation plan, test plan or bullet-list changelog.
git push ssh://<user>@eclipse.gerrithub.io:29418/eclipse-egit/egit HEAD:refs/for/master