Posts

How to rebase selected commits interactively (Git)

Reginald LynchAugust 14th 2021, 10:55
When you are working on a new feature and have branched from an old release into a feature branch, you might want to rebase this branch onto the latest release. When looking into the list of commits on the feature branch, you may realize that some of the commits are...
4980

How to resolve conflicts during a Git rebase (Git)

Reginald LynchAugust 15th 2021, 5:12
When you rebase a commit or a branch on top of a different HEAD, you may eventually see a conflict. If there is a conflict, you will be asked to solve the merge conflict and continue with the rebase using git rebase --continue. Step 1 : Check out the branch...
4648

How to rebase commits to another branch (Git)

Reginald LynchAugust 15th 2021, 9:20
we are going to perform a very simple rebase, where we will introduce a new file, commit that file, make a change to it, and then commit it again so that we end up with two new commits. Step 1 : The jgit repository can be cloned as follows git...
5736

How to Create an orphan branch (Git)

Reginald LynchAugust 15th 2021, 1:36
You are now familiar with Git's data model, the DAG. You have seen that objects have a parent. When you create a new branch, the commit is its parent. However, in some situations, it is useful to have a branch with no parent. Step 1 : It is actually easy...
12718

How to check the difference between branches (Git)

Reginald LynchAugust 15th 2021, 11:35
A regular git diff between two branches will show you all the information, but it can be rather exhausting to sit and look at; maybe you are only interested in one file. Thus, you don't need the long unified diff. Perform the following steps to see the difference between the...
2338

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

Reginald LynchAugust 15th 2021, 12:17
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...
1922

How to force a merge commit (Git)

Reginald LynchAugust 14th 2021, 10:50
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...
12652

How to work with Git and remotes (Git)

Reginald LynchAugust 15th 2021, 12:07
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...
2103

How to Manage local branches (Git)

Reginald LynchAugust 14th 2021, 11:55
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...
2180

How to Configure The refspec

Reginald LynchAugust 15th 2021, 1: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...
4773