git-internals-pdf | PDF on Git Internals | Document Editor library
kandi X-RAY | git-internals-pdf Summary
kandi X-RAY | git-internals-pdf Summary
This PDF explains the internal workings of the Git source code control system. Download the rendered PDF. It was originally written by Scott Chacon and published at PeepCode (now a part of Pluralsight). Scott and Pluralsight have generously open sourced it under the Creative Commons Attribution-ShareAlike license. LICENSE: Creative Commons Attribution-ShareAlike.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of git-internals-pdf
git-internals-pdf Key Features
git-internals-pdf Examples and Code Snippets
Community Discussions
Trending Discussions on git-internals-pdf
QUESTION
I have recently started reading Git Internals to understand how git works under the hood. There is a diagram in this book showing the Git data model :
In this figure I cannot understand what is the meaning of those circles around commit and tree objects. Also the meaning of those three lines from tree to blob is not clear to me. I am wondering if anyone could explain to me what those elements mean in git data model.
...ANSWER
Answered 2020-Nov-10 at 10:35TL;DR: Those circles are actually arrows like the rest of the lines, meaning that commits can reference other commits and trees can reference other trees.
All of the lines in this diagram denotes references, A can reference B.
So:
- HEAD can reference a branch (truthfully, HEAD can also reference directly a commit and bypass the branch but let's not overcomplicate your situation just yet)
- a branch can reference a specific commit
- a tag can also reference a specific commit
- a commit can reference a tree (the "directory" of the repository snapshot)
- a tree can reference one or more blobs, files in that directory
However, the circles you ask about mean this:
- A commit usually refers to its parent commits
- The very first commit in your repository has no parents, and thus reference 0 other commits
- Normal commits that arent merges reference their immediate parent, and thus reference 1 other commit
- Merge commits reference the two parents that were merged (or more than two if you do an octopus merge, again, don't overcomplicate so ignore this part)
- A tree is like a directory of a single folder and can thus reference
- The blobs (files) in that single folder
- Trees that make up subfolders
So that's that those circles mean, commits and trees can reference recursively commits and trees. There might be an arrowhead missing that made it harder to understand, but that's what those circles mean, they're just round arrows really.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install git-internals-pdf
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page