What’s the Difference? Creating Diffs with JGit
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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…