How to Tag commits in the repository (Git)

August 15th 2021, 12:38
Before we start, you must go to the jgit directory, where we made the original clone for this post. We should start by tagging the commit that is ten commits behind origin/stable-2.3 and is not a merge. In order to find that commit, we will use the git log command....

How to Push Git notes to a remote repository (Git)

August 14th 2021, 11:54
Before we can push the notes from the shareNotes repository, we have to create a note to be pushed, as the notes we have now are all available on the remote repository. The remote repository in this case is the jgit directory: Step 1 : You have found a commit...

How to Retrieve notes from the remote repository (Git)

August 15th 2021, 12:06
we need another clone from the local clone we already have. This is to show the push and fetch mechanism of Git with git notes. Step 1 : Start by checking out the master branch: git checkout master Step 2 : Now, create a local branch of all the stable-3.1...

How to Separate notes by category (Git)

August 15th 2021, 12:11
As we saw in the previous example, we can add notes to the commits; however, in some cases, it makes sense to store the information sorted by categories. Notes are stored in refs/notes/commits, but we can add multiple references so that we can easily sort and list the various scopes...

How to Add a Git note (Git)

August 15th 2021, 5:35
We will add some extra information to the already released code. If we were doing it in the actual commits, we would see the commit hashes change. Step 1 : Before we start, we need a repository to work in; you can use the previous clone of jgit, you can...

How to Add rebase with autosquash (Git)

August 14th 2021, 10:59
We will create a branch from origin/master so we are ready to add commits to our fix. Let's start with something like this: git checkout -b readme_update_developer --track origin/master Step 1 : Start by echoing some text into echo "More information for developers" >> Step 2 : This...

How to Change the author of commits using a rebase (Git)

August 15th 2021, 4:06
When starting to work on a new project, it is common to forget to set the author name and author email address for the specified project. Therefore, you will often have commits in your local branch that have been committed with the wrong username and/or email ID. Step 1 :...

How to squash commits using an interactive rebase

August 15th 2021, 4:02
To get started with this example, we need a new branch, namely rebaseExample3, which tracks origin/stable-3.1. Step 1 : Create the branch with the following command: git checkout -b rebaseExample3 --track origin/stable-3.1 Step 2 : Find a commit that is between origin/stable-3.1 and origin/stable-3.2, and list the commits in reverse...

How to rebase selected commits interactively (Git)

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

How to resolve conflicts during a Git rebase (Git)

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