Book Image

Git Essentials

By : Ferdinando Santacroce
Book Image

Git Essentials

By: Ferdinando Santacroce

Overview of this book

Table of Contents (17 chapters)

Viewing the history


Let's continue where we left off in Chapter 1, Getting Started with Git. Walk into C:\Repos\MyFirstRepo and start a new Bash shell using the right-click shortcut. Now, use the git log command to see the history of our repository, as shown in this screenshot:

The git log command is very useful and powerful. With this command, we can get all the commits that we did one by one, each one with its most important details. It's now time to become more familiar with them.

Anatomy of a commit

Commits are the building blocks of a repository. Every repository is nothing more than an ordered sequence of commits. If you have a math background, you have probably already identified an acyclic direct graph in it.

The commit snapshot

Every time we commit something, Git wraps all the files included in a binary blob file. This is one of the most important characteristics of Git. While other versioning systems save files one by one (perhaps using deltas), Git produces a snapshot every time you...