GitHub

How to Tag commits in the repository (Git)

April 18th 2021, 6:03
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....
430

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

April 18th 2021, 4:42
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...
702

How to Retrieve notes from the remote repository (Git)

April 18th 2021, 6:10
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...
404

How to Separate notes by category (Git)

April 18th 2021, 6:08
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...
403

How to Add a Git note (Git)

April 18th 2021, 5:44
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...
574

How to Add rebase with autosquash (Git)

April 18th 2021, 5:49
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 README.md: echo "More information for developers" >> README.md Step 2 : This...
409

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

April 18th 2021, 5:27
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 :...
1293

How to squash commits using an interactive rebase

April 18th 2021, 5:05
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...
1284

How to rebase selected commits interactively (Git)

April 18th 2021, 5: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...
399

How to resolve conflicts during a Git rebase (Git)

April 18th 2021, 5:48
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...
1084