Posts

How to Query the existing configuration (Git)

Reginald LynchJune 22nd 2021, 8:09
we will look at how we can query the existing configuration and set the configuration values. Step 1 : We'll use jgit again by using the following command: git clone https://git.eclipse.org/r/jgit/jgit cd jgit Step 2 : To view all the effective configurations for the current Git repository, run the following...
702

How to Configure targets (Git)

Reginald LynchJune 23rd 2021, 5:00
In this post, we will look at the different layers that can be configured. The layers are as follows: SYSTEM: This layer is system-wide and can be found in /etc/gitconfig GLOBAL: This layer is global for the user and can be found in ~/.gitconfig LOCAL: This layer is local to...
713

How to search through the history code (Git)

Reginald LynchJune 23rd 2021, 3:17
Sometimes, You may want to know which commits touched a specific method or variable. This is also possible using git log. You can perform a search for a string, for example, or a variable or method, and git log will give you the commits, adding or deleting the string from...
613

How to Find commits in the history (Git)

Reginald LynchJune 23rd 2021, 7:53
we will use the JGit repository, trying to find commits related to the "Performance" keyword. In this recipe, we will look through the entire history, so we don't need the master branch to point to a specific commit. Step 1 : we can use the --grep option to find specific...
1089

How to View the history with gitk (Git)

Reginald LynchJune 23rd 2021, 3:31
We saw earlier how we can view the history (the DAG) and visualize it by using git log. However, as the history grows, the terminal representation of the history can be a bit cumbersome to navigate. Fortunately, there are a lot of graphical tools in Git, one of them being...
712

How to Get a list of the changed files in Git

Reginald LynchJune 23rd 2021, 5:41
The same repository and HEAD position (HEAD pointing to 93da791) that we saw in the previous post will be used. The release is also the same, which is v5.8.1.202007141445-r. Step 1 : The following command lists all the files that have changed since the last release (v5.8.1.202007141445-r) git diff --name-only...
1879

How to extract fixed issues in Git

Reginald LynchJune 23rd 2021, 6:26
A common use case of creating a release is to create a release note, containing, among other things, the bugs fixed in the release. A good practice is to write in the commit message whether a bug is fixed by the commit. A better practice is to have a standard...
775

Git is a directed acyclic graph (DAG).

Reginald LynchJune 23rd 2021, 12:12
The history in Git is formed from the commit objects; as development advances, branches are created and merged, and the history will create a directed acyclic graph, the DAG, because of the way that Git ties a commit to its parent commit. The DAG makes it easy to see the...
1358

The Three Stages Of Git

Reginald LynchJune 23rd 2021, 12:40
In this post, we'll see how to create a blob, tree, and commit object in the repository. We'll also learn about the three stages of creating a commit. Step 1 : First, we'll make a small change to the file and check git status: echo "Another line" >> text-file.txt git...
757

What is Git Object

Reginald LynchJune 23rd 2021, 2:22
Introduction In this post, we will take a look at Git's data model The data model of Git is different from other common version control systems (VCSs) in the way Git handles its data. Traditionally, a VCS will store its data as an initial file, followed by a list of...
4159