What’s the Difference? Creating Diffs with JGit

On June 16, 2016, Posted by , In Eclipse, By ,,, , With 20 Comments

In this post, I will dig into the details of how to diff revisions and create patches with JGit. Starting from the high-level DiffCommand all the way down to the more versatile APIs to find particular changes in a file. DiffCommand, Take I The diff command can be used to…

A Help Command for Gonsole

On January 25, 2016, Posted by , In Eclipse,Gonsole, By ,,, , With 8 Comments

We took the 4.2 release of JGit as an opportunity to not only include the new JGit version but also spend some time on Gonsole itself. The result are some bug fixes and smaller enhancements. Most notably there is now a help command. When entered as-is, a list of known…

Getting Started with JGit

On December 15, 2015, Posted by , In Eclipse, By ,,, , With 39 Comments

If you ever wondered how basic Git commands like git init, git checkout and so on are executed in JGit, read on. This tutorial gives an overview of the most commonly used git commands and their counterparts in JGit. It walks through the steps to create a repository, fetch contents…

Gonsole 1.2: Open Git Consoles from Everywhere

On December 7, 2015, Posted by , In Gonsole, By ,,, , With Comments Off on Gonsole 1.2: Open Git Consoles from Everywhere

We have added a little feature to the Git Console for the Eclipse IDE that may be helpful here and there. In the Show In menu (Alt+Shift+W) there is now an entry for the Git Console. The entry is available if a single a file, folder or project is selected…

How to Clone Git Repositories with JGit

On November 30, 2015, Posted by , In Eclipse, By ,,, , With 45 Comments

Whatever you plan to do with an existing repository, first a clone has to be created. Whether you plan to contribute or just want to peek at its history, a local copy of the repository is needed. While cloning a repository with JGit isn’t particularly difficult, there are a few…

Clean Integration Testing with JUnit Rules

On September 28, 2015, Posted by , In JUnit, By ,,,, , With Comments Off on Clean Integration Testing with JUnit Rules

The benefits of JUnit Rules, especially when dealing with integration testing, can hardly be overrated. In this post, we’ll shine a light on the usefulness of ExternalResource extensions. These simplify fixture control in cases where we have to work with external-resource-abstracting third-party libraries. As an example, we’ll have a look…

Initializing Git Repositories with JGit

On May 6, 2015, Posted by , In Eclipse, By ,,, , With 10 Comments

I was recently asked how to initialize a new Git repository with JGit, i.e. achieve what git init /path/to/repo does. While creating a repository with JGit isn’t particularly difficult, there are a few details that might be worth noting. And because there are few online resources on the topic, and…

A Small Update for Gonsole

On January 12, 2015, Posted by , In Gonsole, By ,,, , With Comments Off on A Small Update for Gonsole

If you follow the respective channels you will certainly have read that recently a critical security vulnerability has been discovered in Git. The issue did not only affect Git itself but also all other Git implementations. Among them JGit, which Gonsole uses to actually execute the entered commands. Luckily, together…

JGit Authentication Explained

On December 9, 2014, Posted by , In Eclipse, By ,,, , With 50 Comments

Authentication in JGit is mostly on par with native Git. Commonly used protocols like SSH and HTTP(S) and their authentication methods are supported. This article summarizes how to use the JGit authentication API to access remote Git repositories securely. Though the examples in this article use the CloneCommand, the described…

Explore Git Internals with the JGit API

On October 20, 2014, Posted by , In Eclipse, By ,,, , With 5 Comments

Have you ever wondered how Git stores a commit and its content? Well, I have, and I had some spare time over the last rainy weekend, so I did a little research. Because I feel more at home with Java than with Bash, I used JGit and a couple of…

How to Access a Git Repository with JGit

On September 22, 2014, Posted by , In Eclipse, By ,,, , With 25 Comments

A Git repository is represented in JGit through the Repository class that can be viewed as a handle to a repository. With a Repository instance, you can create JGit commands (through the Git factory class), gain access to configuration settings, resolve refs, etc. There are several ways to obtain a…

Unleashing gonsole 1.0, a Git Console for Eclipse

On July 14, 2014, Posted by , In Eclipse,Gonsole, By ,,, , With 8 Comments

Over the last few weeks, Frank and I had some spare time. As summer hadn’t yet arrived in Germany, we decided to spend that time coding… What came out is Gonsole, a plug-in for the Eclipse IDE which provides a Git Console. The features that we originally intended to implement…

gonsole weeks: a git console for eclipse

On July 9, 2014, Posted by , In Eclipse,Gonsole, By ,,, , With 7 Comments

Even though Eclipse ships with a comprehensive Git tool, it seems that for certain tasks many developers switch to the command line. Because of that, Frank and I started to fill this gap a few weeks ago. If you are interested in what happened during this time you may want…

gonsole weeks: multiple console sessions

On July 2, 2014, Posted by , In Eclipse,Gonsole, By ,,, , With 4 Comments

While Eclipse ships with a comprehensive Git tool, it seems that for certain tasks many developers switch to the command line. This gave Frank and me the idea, to start an open source project to provide a git console integration for the IDE. What happened so far during the gonsole…

gonsole weeks: oops – it’s a framework

On June 26, 2014, Posted by , In Eclipse,Gonsole, By ,,, , With Comments Off on gonsole weeks: oops – it’s a framework

While Eclipse ships with a comprehensive Git tool, it seems that for certain tasks many developers switch to the command line. This gave Rüdiger and me the idea, to start an open source project to provide a git console integration for the IDE. What happened so far during the gonsole…

gonsole weeks: content assist for git commands

On June 18, 2014, Posted by , In Eclipse,Gonsole, By ,,, , With Comments Off on gonsole weeks: content assist for git commands

While Eclipse ships with a comprehensive Git tool, it seems that for certain tasks many developers switch to the command line. This gave Frank and me the idea, to start an open source project to provide a git console integration for the IDE. What happened so far during the gonsole…

gonsole weeks: eclipse egit integration

On June 11, 2014, Posted by , In Eclipse,Gonsole, By ,,, , With 5 Comments

While Eclipse ships with a comprehensive Git tool, it seems that for certain tasks many developers switch to the command line. This gave Rüdiger and me the idea, to start an open source project to provide a git console integration for the IDE. Rüdiger anounced the launch of this project…

gonsole weeks: git init gonsole

On June 3, 2014, Posted by , In Eclipse,Gonsole, By ,,, , With 16 Comments

For many developers, Git has become the tool of choice when it comes to version control systems. Those that work in Eclipse are provided with a comprehensive Git tool integration. But it seems that for certain tasks the command line is favored. Some find it more convenient to type in…

How to manage Git Submodules with JGit

On April 16, 2014, Posted by , In Eclipse, By ,, , With 2 Comments

For a larger project with Git, you may find yourself wanting to share code among multiple repositories. Whether it is a shared library between projects or perhaps templates and such used among multiple different products. The Git built-in answer to this problem is submodules. They allow putting a clone of…

An Introduction to the JGit Sources

On October 28, 2013, Posted by , In Eclipse, By ,, , With 10 Comments

JGit is a pure Java library implementing the Git version control system. It is an Eclipse project and started out as the Git library for EGit, which provides a Git integration into the Eclipse IDE. Meanwhile, JGit has further adopters like in Gerrit, GitBlit, GitClient Plugin for Jenkins (work in…