JGit: Config Loading Optimization

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

08 Sep 2019

Prepare Commit Message using Git Hook

Create a Git hook prepare-commit-msg for inferring JIRA ticket as commit message prefix, based on the branch name.

23 Jul 2019

Merging 20 Git Repositories

Recently, I merged 20 Git repositories into a single one while keeping the history. Here's how I did it.

09 Mar 2019

Customize Git Prompt in MinGW

Customize Git prompt to show dirty-state, untracked files, stash, upstream in your Bash console: MinGW64 (Minimalist GNU for Windows x64).

11 Nov 2018

Merging Git Repositories

Engineering story: how I merge two Git repositories and what are the hidden tasks you didn't think about.

06 Nov 2018

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.

30 Jul 2018

Git: Understanding Git Config

The format of Git internal configuration file (.git/config) is very simple: it has multiple sections, each of which contains multiple options. An option is indeed a key-value pair...

29 Jul 2018

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).

28 Jun 2018

Git: Communication over HTTP

What happens when Git communicates over HTTP protocol? In this post, I'll intercept the HTTP traffic to discover git-receive-pack, git-upload-pack and more.

04 May 2018

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).

02 May 2018

Git: Understanding the Index File

Git index file (.git/index) is a binary file having the following format: a 12-byte header, a number of sorted index entries, extensions, and a SHA-1 checksum. Now let's create a new Git repository, and see how index file changes when a new file is added.

28 Apr 2018

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.

17 Mar 2018

What Is Git Branch?

Many developers use Git in their daily life. Among all the operations, branch commands might be one of the most important part. But do you know what “branch” is, and what are the secrets behind branches? This blog post will share some Git internals with you.

04 Oct 2017

Git Repository Transfer

A step-by-step guide for transferring a Git repository from one place to another while keeping the entirety of the data, including all branches and tags.

01 Jun 2017

Setup GitLab Sever Locally

Here’s the guide about how to setup a GitLab server locally using Docker under mac OS through the following steps:

  1. Create folder in file system to store GitLab data.
  2. Create GitLab container.
  3. Setup GitLab container.
  4. Setup a new user.

10 Mar 2017

Learning Git Basics

Learning Git Basics.

20 Jan 2017

Git Hook for JIRA Number

Git commit hook for checking the JIRA number before commiting.

08 Nov 2016