https://xkcd.com/1597/

The
beauty
of

 

Thomas Herrmann

thomas@42ways.de

Characteristics

content addressed

distributed

reliable

simple

fast

Let's get started

https://git-scm.com/docs/gitrepository-layout

Command types

porcelain

plumbing

 

https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain

porcelain commands

the shiny surface

meant for the end user

housekeeping included

usually used for command line

plumbing commands

get your hands dirty

meant for the craftsmen

where the real work is done

intended to be upward compatible

use it for scripts

Locations

working tree

index

repository

remote

working tree

trees and blobs on local filesystem

based on a branch or other commit

can be "clean" or "dirty"

index

staging area

objects stored, but not commited

manage what the next commit will do

repository

everything Git knows about your files

usually the ".git" subdir of the working tree

may be "bare", i.e. without a working tree

https://jwiegley.github.io/git-from-the-bottom-up/

remote

other repository "somewhere" else

fetch / pull to get changes

push to spread changes

Back to work again

Core data types

objects

references

Objects

include header with type and length

sha1 guaranties integrity

content addressed

compressed

 

https://git-scm.com/book/en/v2/Git-Internals-Git-Objects

Object types

blobs

trees

commits

(annotated) tags

References

pointers to objects

just ordinary text files

reflogs track changes temporarily

 

https://git-scm.com/book/en/v2/Git-Internals-Git-References

Reference types

heads (aka branches)

(simple) tags

HEAD, FETCH_HEAD etc.

Let's do another project

One more thing

Further reading, listening, watching and playing

Source code https://github.com/42ways/the-beauty-of-git

Official Git website (includes Pro Git book) https://git-scm.com/

Tech Talk: Linus Torvalds on Git https://youtu.be/4XpnKHJAok8

Think like a Git - a guide for the perplexed http://think-like-a-git.net/

Git from the Bottom up https://jwiegley.github.io/git-from-the-bottom-up/

A Plumber’s Guide to Git https://alexwlchan.net/a-plumbers-guide-to-git/

git-draw - draw the structure of (tiny) Git repos https://github.com/sensorflo/git-draw/wiki

Interactive illustration of commits, branches, merging etc. https://learngitbranching.js.org/

Learn Git concepts, not commands https://dev.to/unseenwizzard/learn-git-concepts-not-commands-4gjc