Git Internals
Khaled alHabache
khellls@gmail.com
Objects Types
● Blobs
● Trees
● Commits
● Tags
Blobs
● Contents of files are stored as blobs.
● Two files with same content will be
stored once.
● The blob looks like:
●...
Trees
● Directories correspond to trees.
● A tree is a simple list of trees and
blobs that the tree contains, along with
t...
Commits
● The commit is very simple, much like the
tree. It simply points to a tree and
keeps an author, committer, messag...
Tags
● A tag is permanent shorthand name for a
particular commit.
● It contains an object, type, tag, tagger
and a message...
References
● References are simple pointers to a
particular commit
● A branch in Git is nothing more than a
file in the .g...
Thanks!
Upcoming SlideShare
Loading in …5
×

Git internals

195 views

Published on

Git internals, what goes behind the scene.

Published in: Software
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
195
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Git internals

  1. 1. Git Internals Khaled alHabache khellls@gmail.com
  2. 2. Objects Types ● Blobs ● Trees ● Commits ● Tags
  3. 3. Blobs ● Contents of files are stored as blobs. ● Two files with same content will be stored once. ● The blob looks like: ● The blob is zipped and then SHA1 to get the name: 2219632881ae907adbba72cc883d05bae0028730 blob [content size]0 File content here
  4. 4. Trees ● Directories correspond to trees. ● A tree is a simple list of trees and blobs that the tree contains, along with the names and modes of those trees and blobs. ● The tree is zipped and then SHA1 to get the name: 342f6asdg1ae907adbba72cc8095dsds0028730 tree [content size]0 100644 blob 221963 file name
  5. 5. Commits ● The commit is very simple, much like the tree. It simply points to a tree and keeps an author, committer, message and any parent commits that directly preceded it. ● The commit is zipped and then SHA1 to get the name: e12f3463g1ae907adbba72cc8095dsds0028730 commit [content size]0 tree 342f6asd author John Smith john@smith.com committer John Smith john@smith.com commit message
  6. 6. Tags ● A tag is permanent shorthand name for a particular commit. ● It contains an object, type, tag, tagger and a message. ● The tag is zipped and then SHA1 to get the name: e12f3463g1533dffjf3343s2111fd453absdce18 tag [content size]0 object e12f346 type commit tag name committer John Smith john@smith.com commit message
  7. 7. References ● References are simple pointers to a particular commit ● A branch in Git is nothing more than a file in the .git/refs/heads/ directory that contains the SHA-1 of the most recent commit of that branch. ● They are simple pointers to a particular commit, something like a tag, but easily moveable.
  8. 8. Thanks!

×