Home » Tag Archives: JGit

Tag Archives: JGit

Getting Started with JGit

git-logo

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 from a remote, add and remove files to/from the history, ...

Read More »

How to Clone Git Repositories with JGit

git-logo

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 details that might be worth noting. And because there are ...

Read More »

JGit Authentication Explained

git-logo

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 securely access remote Git repositories. Though the examples in this article use the CloneCommand, the described techniques can be applied to all classes that connect to ...

Read More »

Explore Git Internals with the JGit API

git-logo

Have you ever wondered how a commit and its content is stored in Git? 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 learning tests to explore the Git internals of ...

Read More »

How to Access a Git Repository with JGit

git-logo

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 repository reference and because I have seen people having trouble ...

Read More »

How to manage Git Submodules with JGit

git-logo

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 are submodules. They allow putting a clone of another repository as a subdirectory within a parent repository (sometimes ...

Read More »

An Introduction to the JGit Sources

git-logo

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 Eclipse. Meanwhile JGit has further adopters like in Gerrit, GitBlit, GitClient Plugin for Jenkins (work in progress), … Its permissive license, few dependencies and low requirements make it ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Advanced Java Guide
  • Java Design Patterns
  • JMeter Tutorial
  • Java 8 Features Tutorial
  • JUnit Tutorial
  • JSF Programming Cookbook
  • Java Concurrency Essentials