![]() ![]() What are these types: blob, tree, and commit? Let’s start at the bottom and work our way up. Hint: e0c03f27484 commit - contrib/buildsystems: ignore irrelevant files in Generators/ If we request the type of an object using an abbreviated OID that is too short, then we will see the list of OIDs that match $ git cat-file -t e0c03 This string is given as something long enough that only one object in the repository has an OID that matches that abbreviation. You might also be used to seeing OIDs given as a shorter hex string. Each object is essentially a plain-text file and we can examine its contents using the git cat-file -p command. We will use the git rev-parse command to discover these OIDs. The most important part to know about Git objects is that Git references each by its object ID (OID for short), providing a unique name for the object. Follow along with my command-line examples for extra practice. I’ll be using the git/git repository checked out at v2.29.2 as an example. If you want to go really deep, you should read the Git Internals chapter of the Pro Git book. After we investigate this model, we’ll explore how this new perspective helps us understand commands like git cherry-pick and git rebase. I believe that Git becomes understandable if we peel back the curtain and look at how Git stores your repository data. However, commits are snapshots, not diffs! In my experience, the root cause of this confusion is an interpretation of commits as diffs that can be shuffled around. This is most apparent in commands that “rewrite history” such as git cherry-pick or git rebase. Users stumble over terminology and phrasing that misguides their expectations. Git has a reputation for being confusing. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |