Skip to content Skip to sidebar Skip to footer

Commitlogreadexception: Could Not Read Commit Log Descriptor

Git Log In the dot git folder tutorial, we learned that Git records everything that happens in its repositories. And why it shouldn't? After all, it is a Version Command System and information technology has to be efficient in it. The term which captures all the changes happening inside the repository Git Log  is the same equally it is used in Database and in normal life. A logger in terms of computers means a device or computer plan that records the events or observations or measurements. In Git besides, this procedure is called logging and equally we will report in the next section, nosotros use git log control for accessing the logs. This tutorial volition constitute the following:

  • What is Git Log?
  • Git command to view commit history
  • Git command to view commit history for a file
  • Git command to view commit history of a range
  • Git command to view a limited number of commit history

What is Git Log Command?

Git log is a control used in Git to access the history of commits that the repository has gone through. A simple log control is executed by typing the following command inside git:

git log

Git Log

Note : I have used this image as a reference in the consummate tutorial below. Delight keep this in mind.

As you can meet not merely the commit history with the commit identifier is shown. These commits are shown in reverse chronological guild (the last commit will be shown on the pinnacle). It also includes diverse other data which is extremely useful since the Git repository is not used by a unmarried person. A Git repository is also accessed and used by many remotely. This running log of commits contains the following iv pieces of data:

  1. Commit Hash : The first part of the commit log is "commit hash" which is the hash value by which Git saves or refers everything internally. Refer to the Dot Git binder to know more.
  2. Commit Author : This office tells you virtually who committed the changes in the repository i.e. the author name.
  3. Commit Date : This role shows you the appointment and time of the commit with the twenty-four hours and time zone. It is of import to accept a mean solar day and time zone because many people work on a single project from unlike geographical locations.
  4. Commit Bulletin : This part shows the commit message that was written while committing the changes. Refer to this tutorial to acquire how to write practiced commit messages.

Obviously, not everyone would like to see a long list of commits. Anybody has their ain preference and Git takes intendance of this. Git log has many options that help to filter out the commit history according to you lot and giving some ability to the Git Log. Let'south meet those options.

How to view Squashed Commit History with Git Log?

Line option in git log is used for viewing the condensed view of the commit history that we simply saw above. To see how it looks, blazon the following command and press enter:

git log --oneline

Git Log OneLine Command

Note : It is a double hyphen earlier oneline, which yous tin see in the screenshot.

Equally you can see some of the details that were previously visible are now subconscious and the view is of only one-liner. This is much understandable since every commit is now shown in a single line, starts with Commit Id followed past Commit Message .

  • Commit Id : Every commit has a commit id which is actually a compressed version of commit hash. Since a commit hash is not a sequential number, compressing it withal shows unique commits.

  • Commit Message : It is clear with a message (commit message to sympathise what the commit was about) and short.

How to view Commit History past Commit ID with Git Log?

Now, yous must be wondering equally a programmer that you executed oneline control and so that you can locate your required commit through the message. Now, yous want to see the details of it. It is not showing in oneline and you don't want to get through the headache of git log command and locate again. To solve this, type the following command:

git log <commit hash>

Git Log Hash

Annotation : The commit hash you use will be used equally a get-go hash. All the commits did earlier that will be shown equally usual.

How to view Commit History of a File past Git Log?

Log command produces the commit history in reverse chronological order. These commit histories are of the repository and a single repository may contain many files. Log command provides an option to view the commit history of a item file. This option is <filename>. A specifier maybe. To execute, type the following control:

git log <filename>

Git Log Filename

Note : These are the commits that take been done on the file named harish.txt.

How to view Commits History for a range?

Specific commit history refers to the history that is from a defined commit to another defined commit. As we saw in the to a higher place section, commit history contains an id for every commit shown. This is called a commit identifier. A unique id for the commit. To execute the same, type the following command:

git log <since commitId>..<until commitId>

Log Since Until Command

Since and until volition take the identifier of the git commit (id). As you can run into in the results, information technology does not include the "since" function of the id merely includes the "until" part. You lot can as well see that even though since comes kickoff does not hateful you accept to enter the latest commit.

  • Since means, the last commit upwardly to which you want to see.
  • Until means, the latest commit that yous would like to encounter.

Retrieve that nosotros run into reverse chronological gild in Git and not normal chronological lodge. As a exercise, I would similar you to interchange since and until ids above and see how Git Bash responds to it.

Combine oneline option with since..until to have a compressed view of the same.

Log Since Until with Oneline

How to view a limited number of Git Commits History?

Commits tin too be viewed by assigning a specific number. For example, we can view the last 4 commits that happened in our repository. It is a very simple git command which needs no explanation.

git log -n iii -oneline (result last three git commits)

Log Specific Commits

As you tin can meet, y'all have got the final three commits with ane-line descriptions.

Git log is a very important command in this class and your Git learning journey. Git log helps you see the by commits which helps to run across who did what in Git and the repository. Information technology helps you track the changes that happened in your repository. Mix the options with the commands to explore more in the Git log. We will head on to our next tutorial.

mooreeptich.blogspot.com

Source: https://www.toolsqa.com/git/git-log/

Postar um comentário for "Commitlogreadexception: Could Not Read Commit Log Descriptor"