Posts

How to force a merge commit (Git)

Reginald LynchJune 23rd 2021, 5:09
Git supports almost any workflow. We have often encountered a situation that requires a merge commit while merging a feature, even though it can be done with a fast-forward merge. Those who requested it often use it to indicate that you have actually merged in a feature and want to...
2465

How to work with Git and remotes (Git)

Reginald LynchJune 23rd 2021, 4:21
At some point, it is very likely that you have cloned somebody's repository. This means that you have an associated remote. The remote is usually called origin because it is where the source originated from. While working with Git and remotes, you will get some benefits from Git. Follow these...
897

How to Manage local branches (Git)

Reginald LynchJune 23rd 2021, 4:08
Let's start by creating a few local branches. Step 1 : Use the following command to clone the jgit repository to match: sudo apt install git cd jgit Step 2 : Whenever you start working on a bug fix or a new feature in your project, you should create a...
906

How to Configure The refspec

Reginald LynchJune 23rd 2021, 10:38
In this post, we'll be using the jgit repository as our server repository, but we have to make a clone of it to a bare repository so we can push it. You can't push to the checked-out branch on a non-bare repository, as this can overwrite the work area and...
1217

How to use Git aliases

Reginald LynchJune 22nd 2021, 8:06
An alias is a nice way to configure long and/or complicated Git commands to represent short useful ones. An alias is simply a configuration entry under the alias section. It is usually configured to --global to apply it everywhere. Step 1 : In this post, we will use the jgit...
857

How to Configure Autocorrect (Git)

Reginald LynchJune 23rd 2021, 9:34
This configuration is useful when you get tired of messages such as the following one just because you made a typo on the keyboard: git statis By setting the configuration to help.autocorrect, you can control how Git will behave when you accidentally send a typo to it. By default, the...
915

How to Configure Expiry Objects (Git)

Reginald LynchJune 23rd 2021, 4:49
By default, Git will perform garbage collection on unreferenced objects and clean reflog for entries that are more than 90 days old. For an object to be referenced, something must point to it; a tree, a commit, a tag, a branch, or some of the internal Git bookkeeping, such as...
718

How to Configure Rebase and merge (Git)

Reginald LynchJune 23rd 2021, 4:01
By default, when performing git pull, a merge commit will be created if the history of the local branch has diverged from the remote one. However, to avoid all these merge commits, a repository can be configured so that it will default to rebase instead of merging when doing git...
2163

How to create a git directory template

Reginald LynchJune 23rd 2021, 6:04
Sometimes, having a global configuration isn't enough. You will also need to trigger the execution of scripts (also known as Git hooks), exclude files, and so on. It is possible to achieve this with the template option set to git init. It can be given as a command-line option to...
1533

How to Create a template commit message (Git)

Reginald LynchJune 23rd 2021, 3:15
we will see how to create a template commit message that will be displayed in the editor when creating a commit. The template is only for the local user and not distributed with the repository in general. Step 1 : we will use the example repository from this post git...
3148