How to use git reuse recorded resolution (rerere) to merge Git conflicts

Reginald LynchJuly 29th 2021, 8:25
When you work on long-living feature branches, you end up in a situation where you have the same conflicts occurring repeatedly. Here, you can use git rerere, which stands for reuse recorded resolution. Git rerere is not enabled by default, but can be enabled with the following command: git config...

How to force a merge commit (Git)

Reginald LynchJuly 29th 2021, 9:10
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...

How to work with Git and remotes (Git)

Reginald LynchJuly 29th 2021, 8:11
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...

How to Manage local branches (Git)

Reginald LynchJuly 29th 2021, 9:46
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...

How to Configure The refspec

Reginald LynchJuly 29th 2021, 10:09
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...

How to use Git aliases

Reginald LynchJuly 29th 2021, 8:40
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...

How to Configure Autocorrect (Git)

Reginald LynchJuly 29th 2021, 8:13
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...

How to Configure Expiry Objects (Git)

Reginald LynchJuly 29th 2021, 8:32
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...

How to Configure Rebase and merge (Git)

Reginald LynchJuly 29th 2021, 8:08
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...

How to create a git directory template

Reginald LynchJuly 29th 2021, 10:02
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...