JGit (jgit)

JGit background

JGit is an EDL (new-style BSD) licensed, lightweight, pure Java library implementing the Git version control system:

  • repository access routines
  • network protocols
  • core version control algorithms

JGit has very few dependencies, making it suitable for embedding in any Java application, whether or not the application is taking advantage of other Eclipse or OSGi technologies. JGit can be found within: EGit, Gerrit Code Review, NBGit, GitBlit, etc. For more detail, see the official website: https://www.eclipse.org/jgit/.

My blog posts:

Performance Improvements on Nuxeoctl

How NOS team improves the performance of Nuxeoctl, Nuxeo Server's command line, recently.

JGit: Config Loading Optimization

How JGit optimizes internally the configuration loading process using file snapshots and reduces unnecessary file I/O?

JGit: Protect Branches on Git Server

If you're using JGit for your Git server, you can combine Git config (.git/config) and a customized pre-receive hook to protect branches on a specific Git repository.

JGit: Customize Git references using RefFilter

This post explains how to apply a Git reference filter to your Git server in Java. It allows you to customize Git references before sending data to clients (upload-pack).

Git: Upstream Tracking Understanding

A quick introduction about Git upstream tracking: set upstream with git-push or git-branch, the internal mechanism inside Git config (.git/config), unset upstream, and related implementation in Java (JGit).

JGit Internal: Reference and RevObject

Today, I want to discuss Git internal mechanism with you: How Git resolves references? How JGit, a pure Java implementation of Git, resolves references in Java? Then, how to use them via class RevObject and its subtypes.