►
Description
In this session, Matt Duff will write the remedial functionalities of Git in Ruby, giving us a greater understanding of the simplicity that underpins Git.
About GitMerge
Git Merge is the pre-eminent Git-focused conference: a full-day offering technical content and user case studies, plus a day of workshops for Git users of all levels. Git Merge is dedicated to amplifying new voices in the Git community and to showcasing the most thought-provoking projects from contributors, maintainers and community managers around the world. Find out more at git-merge.com
A
Now,
it's
a
fantastic
place
to
work
before
that
I
worked
at
a
financial
services
company
in
Utah
called
MX,
and
they
both
been
fantastic
and
great
users
of
git.
So
the
prior
art
for
this
talk
is
a
few
different
places
that
I've
just
seen
someone
give
similar
presentations
and
wanted
to
do
a
variation
of
it.
One
of
them
is
this
person
at
github.
You
give
a
talk
called
Ross
get
Scott
gave
this
and
he
and
I
were
at
a
conference
one
day
and
he
passingly
mentioned
it
as
we're.
A
Manning
a
booth-
and
he
said,
I
gave
this
talk
one
time,
I
looked
at
it
and
thought
that's
a
cool
way
to
approach
this,
and
a
lot
of
this
talk
is
similar
to
what
he
gave
back
then
and
then
I
attended,
I
think
last
year
it
get
merged.
She
gave
a
similar
talk
to
this
Emily
and
then
I
also
tended
off
Kahn
in
Austin
Texas
last
year,
and
she
gave
this
talk
there
and
I'll
and
I
loved
how
she
approached
it
and
I
thought
she
was
a
fantastic
teacher.
A
So
this
is
a
defect,
ingushetia,
tinder
internals
and
she
focused
mainly
on
the
plumbing
commands,
underneath
the
porcelain
and
I
thought.
That
was
how
she
approached.
It
was
really
neat
I,
highly
recommend
going
and
watching
that
talk
and
all
you
can
get
all
these
access
to
these
later
for
the
links
and
another
one
is
by
my
colleague
at
github,
Matthew
McCullough.
This
is
a
fantastic
talk
as
well.
This
is
on
YouTube
as
well.
It's
advanced,
get
graphs,
hashes
and
compression.
A
Oh,
my
Matthew
does
a
fantastic
job
in
this
of
really
explaining
most
things
that
are
happening
inside
of
it.
It's
much
more
abroad
than
this
one's
going
to
be
on.
He
does
a
deeper
dive
into
some
things
as
well
and
plays
out
the
graph
well,
but
this
is
also
a
really
great
way
place
to
go
and
to
get
a
deeper
dive
in
and
then
probably
the
source
material.
A
Possibly
for
all
of
these
previous
talks
is
pro
get
the
book
by
scott
kohn,
who
is
a
getup
founder
that
one
you
can
go
and
access
free
on
the
internet
and
that's
a
fantastic
resource
as
well
so
I.
My
hope
of
giving
this
talk
is
that
you
will
find
get
to
be
much
more
approachable.
Many
of
you
probably
could
run
circles
around
me
and
you're
get
knowledge.
I
am
definitely
assuming.
That
is
the
case,
but
some
of
the
potentially
new
where
people
forget
it.
A
It
hopefully
helps
to
pull
back
the
curtain
a
little
bit
and
demonstrate
you
know
how
simple
of
a
system
it
really
is
and
brilliant
in
its
design,
I
believe
and
then
furthermore,
well
what
we'll
go
through.
Creating
two
different
get
objects
in
this
talk.
Try
to
recognize
the
pattern
that
we
do
with
each
one.
A
So
we
create
a
blob
when
we
create
a
committee
when
we
create
a
tree,
there's
a
very
specific
pattern
that
we're
doing
with
these
simple
Ruby
command
line,
commands
and
so
definitely
recognize
that
and
then
go
try
to
make
a
more
complex
one
later
and
that
yeah
the
Ruby
is
very
simple
in
it.
It's
really
mostly
strings
and
string
interpolation
of
previous
objects
that
you've
created.
So
it's
it's
even
it's
it's
very
a
new
user
to
to
get
or
to
program
and
could
probably
get
a
pretty
good
grasp
of
it.
A
Just
because
of
how
simple
the
required
tools
are-
and
hopefully
you
build
on
this
talk.
So
hopefully
you
you
hear
this,
you
give
it
to
people
that
you
know
and
and
try
to
help
them
see.
You
know
just
lets.
You
know
you're,
not
understanding.
What
a
commit
is,
let's
take
five
minutes
and
build
one
out,
so
we
can
actually
show
you
how
it
actually
happens
behind
the
scenes,
underneath
the
the
porcelain
and
the
plumbing
and
and
then
hopefully
give
a
better
talk
in
the
future.
A
Alright
well
hop
in
now.
So
what
is
get
get,
as
you
all
know,
is
a
content.
Addressable
filesystem
I
assume
that
you
all
know
that
how
that
really
is
impactful
is
when
you,
when
you
look
into
the
get
the
gate
directory,
you
can
see
all
the
files
that
get
is
storing
and
all
the
content
that
it
has
in
there
to
varying
levels
depending
on
the
state
of
the
repository
and
the
content
is
what
is
actually
important.
A
So
what
are
gets
objects
there's
blobs,
which
are
your
files,
and
you
know
this.
This
can
be,
you
know
the
hello
world
string
or
it
can
be
something
a
lot
much
larger,
but
it's
mainly
just
a
file
that
you
write
and
sees
your
source
code
files.
This
is
the
content
and
a
gate
will
make
an
object
from
that.
A
A
Let's
jump
now
and
I'm
going
to
create
a
repository
which
will
be
the
repository
that
we
go
and
build
through
these
Ruby
commands
and
I'm
going
to
do
it
through
just
the
normal,
the
normal
get
porcelain
commands.
So,
for
instance,
right
here
you
know
I'm
in
my
projects,
github
get
merged
directory
and
I
make
a
new
directory
called
good
example.
A
I
CD
into
that
repository,
I
initialize
get
so
it
initializes
it
and
then
that's
where
most
people
kind
of
don't
really
care
what's
happening
after
that
they
think
that's
good
and
for
my
few
years
of
of
using
git
that
was
probably
where
I
was
at
to
where
I
just
I
knew
that
it
was
bringing
me
to
the
next
step.
But
it's
really
important
to
say
you
know,
ask
yourself,
what's
inside
of
that.
What's
inside
of
that
repository,
so
you
can
see
that
we
have.
A
We
have
the
dot
git
hidden
folder
in
there,
and
then
we
have
all
of
these.
These
four
or
five
other
directories
in
here
files
and
there's
a
whole
bunch
in
there,
but
there's
some
that
are
more
important
than
others,
for
instance,
to
get
objects.
Folder
is
the
primary
place,
we're
good
at
storing
these
things,
so
it
created
all
that
just
by
typing
and
getting
it,
but
none
of
our.
If
you
can
see
in
the
objects
area,
there
are
no
there's
no
content
yet
inside
of
git,
it's
just
a
boilerplate,
repulsive
to
our
folders
and
files.
A
So,
let's
start
creating
some
content.
So
still
with
with
the
porcelain
commands,
you
know
you
can
just
I
just
do
them.
Readme,
MD
and
type
in
hello
world,
save
it
and
close
it
out,
and
you
have
your
a
an
example
readme
file
and
that
file
was
stored
and
git.
So
now,
if
we
do
that
same
command,
we
haven't
done
any
committing
or
anything
of
that
nature,
but
it's
added
it
in
there
and
it
says,
get
three
well.
The
three
b18
is
the
hash
of
that
file.
A
A
Most
people
is
gloss
over
when
they
first
get
started
and
then
what
is
in
the
repository
now
so
now
we
have
files
in
there
with
a
directory,
as
you
can
tell
I,
don't
have
a
pointer,
but
if
you
can
tell
them
the
objects,
you
have
the
21
folder,
the
3b
folder
and
the
43
folder.
It
created
those
folders
and
then
put
the
file
inside
of
there
the
content
inside
of
there.
A
So
that's
where
those
three
files
are
those
three
files
from
just
creating
that
one
folder
in
the
commit
it
created
a
snapshot
of
the
file
it
created
at
the
tree
of
the
directory
when
it
was
at
at
that
point
and
it
also
created
the
commit.
So
that's
what
we
have
right
there
and
there's
a
lot
of
things
happening
there,
but
not
a
lot
of
people
dive
into
how
that
happens.
So
we're
going
to
jump
in
now-
and
this
is
probably
one
money-
I-
don't
love
that
this
part
of
the
movie
so
much.
A
But
let's
do
this
thing:
let's
go
ahead
and
start
using
some
Ruby
and
jump
in
and
make
a
directory
just
an
IRB
on
the
command
line.
So,
to
start
off,
we
just
didn't
make
directory
get
simple:
Ruby
and
CD,
get
simple
Ruby
to
jump
in
and
then
manually
make
the
dot,
git,
folder
and
sub
directories.
So
you
jump
into
there
and
do
make
turgut
so
we're
not
doing
get
in
it.
That's
the
main
difference
here
and
we
are
creating
that
the
objects
folder
in
there
and
that
is
empty
at
this
point.
A
A
So
with
that
in
there
we're
going
to
jump
in
and
create
the
file
content
in
IRB,
and
to
do
that,
we
just
do
blob
content
and
then
I
just
add
hello
world.
That's
all
I
have
and
I'm
making
the
exact
same
one
that
I
made
in
the
other
example,
and
that
returns
back
hello
world.
It's
pretty
simple
string
right
now
we
create
the
file
header,
and
this
is
going
to
make
it
far
easier
forget
to
tell
you
what
the
objects
are.
A
After
when
you
use
some
of
those,
you
know
more
plumbing
commands
just
to
cat
files
and
stuff
like
that
and
get
or
the
porcelain
commands
you
can
it'll
use
some
of
this.
These
values,
with
the
content
of
your
actual
file,
to
tell
you
details
about
it,
so
it'll
use
the
type
and
then
you'll
have
blob
underscore
content.
Dot
length
is
grabbing
the
length
of
that,
and
then
you
have
the
null
byte
character
at
the
end
and
then
by
their
powers
combined
the
header
and
the
content.
A
When
you
add
those
two
together,
you
get
Captain
Planet,
Kyle's
gift
game.
I
promised
you
before
is
way
stronger
than
mine,
but
this
is
one
of
my
favorite
childhood
shows.
So
you
get
the
this
string
right
here,
so
we
we
save
it
as
a
variable
called
blobstore,
and
we
do
blob
header
plus
blob
content
with
a
newline
and
that
creates
that
I
just
broke
it
apart.
A
Just
because
it's
simpler
for
me
when
I
was
going
through
to
create
it,
build
it
out
this
way
and
you
get
blob
the
twelve
that
null
character,
the
hello
world
and
the
newline,
and
so
we
have
the
content.
But
we
don't
have
a
hash
yet
so
we
know
what
the
hash
is
going
to
be.
The
signature
of
that
of
that
file
is
going
to
be
now.
A
We
need
to
actually
make
the
hash
and
the
hash
is
very
important
for
the
file,
the
content
addressable
file
system,
because
that
is
the
identifier
for
the
actual
content
and
what
it
will
look
like.
So
when
we
build
out
the
combination
of
the
header
and
the
file
content,
that
together
becomes
what
the
file
actually
is
and
we
make
a
fingerprint
of
it.
So
we're
saying
this
is
this:
is
its
fingerprint.
A
It
can't
be
anything
but
this
because
of
the
content
of
that
file,
we
will
require
digest
sha
in
IRB
and
we
will
run
the
command
and
it
gives
us
this
long,
accessible
string
of
three
be
one.
Eighty
five
one
two,
and
that
is
the
signature
for
hello
world
with
our
header.
So
now
we
can
compress
the
file.
So
now
git
will
compress
this
file
before
it
actually
saves
it.
And
what
we're
doing
right
now
is
the
hash
object.
A
The
hash
object,
plumbing
command.
So
now
it's
time
to
compress
that
file.
So
we
go
in
there
and
we
require
Z
Lib
and
we
go
in
and
do
Z
Lib
blobstore
equals
Z
Lib
deflate
deflate
blobstore,
which
is
the
one
from
previous,
and
it
gives
us
this
very
nice
string,
and
you
don't
have
to
worry
about
that.
Though.
You
just
have
to
worry
about
the
Z
lib
blobstore
and
this
file
now
needs
a
directory.
A
So
we
have
the
content,
it's
been
compressed
and
now
we
need
to
actually
put
it
inside
of
get
to
actually
save
it
in
to
get
so.
We
jump
in
to
IRB
again
and
we
do
directory
make
directory
and
we
tell
it
to
save
it
in
the
get
objects.
And
then
we
do
a
little
string
interpolation
to
pull
out
from
that
shawwal
that
40
character
or
symbol.
The
first
two
characters
to
make
the
directory
so
we're
going
to
make
the
directory
that
it
goes
in
first.
A
So
we
drop
that
in
and
it
creates
it
there
and
then
we
have
that
directory
created.
So
now
that
the
directory
is
created,
then
with
Ruby
again
we
go
in
and
make
the
actual
file.
So
I
just
wrote
a
file
open
and
then
did
get
objects,
blob,
hash,
oh
and
then
that's
telling
it.
You
know
you're
making
the
path
right
now
to
where
it's
going
to
be,
and
then
the
second
part
of
that
is
actually
hashing,
the
third
238
third
to
40th
character.
A
So
now,
if
we
do
a
fine
dot,
we
have
that
three
B
folder
that
we
created
and
then
we
also
have
the
1/8
the
rest
of
that
hash
as
the
actual
content,
so
that
readme
file
now
has
representation
inside
of
get
just
from
relatively
few
Ruby
commands
that
we
did
just
an
IRB
in
a
couple
minutes.
What
does
the
get
logs
command
now
tell
us?
It
tells
us
that
we
do
not
have
a
repository
yet
certainly
so
that
is
that's
not
going
to
work,
and
that
makes
sense,
because
we
just
have
a
file.
A
We
don't
have
any
commits,
or
anything
like
that,
and
the
logs
are
telling
us
our
commits.
So
let's
start
building
out
those
other
aspects
that
we
need
to
actually
have
a
semi
functional,
get
repository
from
Ruby.
So
now
we
jump
in
and
we
make
the
tree.
The
tree
is
the
folder
representation
at
the
time
of
the
commit
so
and
we
create
that
directory.
This
is
what
values
that
need,
so
it
will
have
the
object
beginning
like
before
we
had
blob.
A
So
it'll
be
a
little
bit
more
clear,
but
we
grab
our
file
hash.
This
is
the
blob
hash,
so
we
have
that
from
the
previous
one,
and
that
is
the
representation
of
the
readme
file
in
that
directory.
So
we
can
make
the
directory
and
then
let's
write
out
the
trie
content.
We
have
the
the
mode.
We
have
the
file
name,
the
null
byte
and
we
have
blob
hash
and
path
to
compress
it.
A
So
it's
not
that
40
character
string
and
then
this
is
what
it
will
look
like
if
we
cat
at
that
file
after
those
values
up
above
are
used
here.
So
you
have
the
mode,
the
type
the
string
and
then
the
file
name
there.
So
you
can
so
you
can
check
and
see
what
objects
are
inside
of
get
then
we're
going
to
create
the
combination
of
this
header
for
that
tree
and
the
content
as
well.
So
now
we're
doing
tree
content.
A
This
is
what's
inside
of
it,
it
has
those
characters
in
there
and
then
we
make
the
header.
So
we
also
do
tree
tree
content,
dot
length,
plus
an
L
by
plus
the
tree
I
mix
these.
These
are
repeating
a
little
bit
just
to
demonstrate
it
a
little.
But
that's
the
tree.
Header,
Oh
and
then
I
hit
escape
sorry
one
sink.
Then
we
have
that
and
then
we
combine
the
tree
content
and
the
tree
header.
A
So
this
is
the
actual
content
of
what's
going
in
all
combined,
so
we
have
the
tree
store,
which
is
what
we're
saving
this
as
the
tree
header,
which
is
the
first
part
of
the
string
and
then
that
second
part
that's
been,
that
has
those
characters
is
the
tree
content
and
then
we
were
make
sure
we
have
our
required
libraries
just
like
in
the
previous
step
before
we
start
compressing
and
adding
it.
So
we
have
tree
hash,
equals
digest.
Sha-1
hex
digest
restore
from
the
previous
slide,
and
it
gives
us
back
that
sháá.
A
So
the
SHA
is
what
that
file
will
actually
look
like
in
'get
folders,
and
now
we
can
create
the
directory
for
the
object.
So
this
is
that
pattern
that
I
was
referencing
before
there's
a
very
similar
pattern
for
every
object.
So
now
we
create
the
directory,
we
again
grab
the
first
two
characters
of
the
SHA
and
we
then
make
sure
we
add
the
file
after
in
the
newly
created
directory.
A
So
we
do
file
open
and
then
save
it
just
just
like,
before,
with
the
last
characters
being
the
file
name
and
still
doesn't
work,
we
run
get
log
with
commit.
So
if
we
we
have
to
go
and
now
create
the
commit,
because
we
have
the
tree,
we
have
the
file,
but
we
do
not
presently
have
a
working
git
repository
in
the
way
that
you'd
anticipate.
So
we
can
now
create
the
commit
content,
and
this
is
what
it
looks
like
when
you
create
the
content
with
some
new
lines
in
there.
A
So
we
have
the
commit
content
variable
up
there
and
we
make
a
reference
to
the
tree
so
that
the
commit
knows
where,
where
it's
coming
from,
we
have
the
author,
that's
myself.
We
have
the
committee,
which
is
myself.
We
have
the
created
readme
file,
which
is
the
message
and
then
we
end
the
string
and
that
spits
back
all
of
this
string
on
the
bottom.
The
bottom
two
lines
so
we're
building
out
now
that
into
the
system.
So
now
we
have
that
simply
the
content.
A
Now
the
header
is
the
commit
the
object
type,
which
is
the
commit
part
in
the
variable,
and
then
we
do
the
length
again
as
well
and
then
a
byte
there
at
the
end
and
no
bite.
So
then
we
have
combined
them
for
the
complete
content,
the
content
and
the
header,
and
we
get
this
long
string.
So
that's
what
the
sha-1
is
going
to
be
created
from
and
we
create
the
new
folder
for
the
commit.
So
we
dive
in
and
we
make
the
directory.
A
We
do
the
first
two
characters
for
the
folder
and
we
add
the
file
to
the
new
directory
like
before.
And
what
is
our
directory
look
like
now?
It
has
all
these
files
in
there
so
there's
three
files
in
there,
so
we
created
the
blob.
We
created
the
tree
and
now
we
have
a
commit
all
inside
of
the
repository,
and
so
this
is
still
ending
a
wildly
simple.
You
know
there's
no
refs
folder
in
here,
yet
it's
a
wildly
simple
get
repository
which
will
not
work
if
you
run
git
logs,
because
there
are
no
references.
A
So
at
this
point
to
this
is
that
this
is
good
to
point
out
at
this
point,
the
the
there's
one
that
I
created
before
with
the
porcelain
commands
and
that
did
everything
for
us.
These
are
the
same
values
as
the
other
one,
except
for
the
except
for
the
commit
file,
because
that
has
timestamps
in
it
so
other
than
that,
though,
that's
the
same
tree
and
file
hash
as
before,
because
it's
the
same
content
and
that's
how
that
system
works.
So
now,
if
we
go
and
look
get
logged
is
still
not
work.
A
So
it'll
still
say
it's,
not
it's
not
a
directory,
so
we're
missing
our
references.
So
let's
add
that
to
the
folder,
so
we
jump
in
and
we
do
make
der
P
get
refs
heads
to
make
sure
that
it
makes
refs
and
heads,
and
then
we
add
the
master
branch
reference
with
your
commit
shop.
So
we
need
a
reference
that
there's
that
to
get
that,
this
is
actually
a
branch
as
well
and
we're
going
to
make
it
just
automatically
the
master
branch.
A
And
so
we
dive
in
here
and
do
echo
the
commit
message
and
then
add
that
to
get
refs
heads
master
and
then
we
let
head
know
to
go,
look
into
master
to
see
what
the
current
one
is.
So
we
echo
ref
refs
heads
master
to
get
head
and
then
it's
hooked
up
and
it
knows
where
to
go
and
does
it
work
now
it
does
get
logged
works.
A
So
now,
when
you
run
the
git
log
command,
it's
aware
of
the
content
that's
in
there
and
you
can
also
make
run
many
normal
git
commands
now
with
just
a
simple
Ruby
created
repository.
So
you
can
see
up
here
at
the
top.
I
ran,
get
cat
file
P
and
that
pulls
that
decompresses
that
file,
that
the
readme
MD
file
and
spits
back
hello
world,
which
is
the
content
there.
The
get
cat
file
T
tells
us
the
type
of
each
of
these
three
objects
in
the
database,
the
blob
the
tree
and
the
commit.
A
So
these
commands
are
working.
Fine.
My
little
bash
profile
script
is
recognizing
the
master
branch
now,
because
it's
in
that
file
and
things
are
working
just
fine.
Now,
there's
obviously
far
more
complexity
in
sight
of
git.
On
top
of
this,
this
is
a
you
know,
a
fundamentals
of
how
good
objects
work,
but
the
repository
is
functional
so
that
what
can
you
do
with
that
knowledge?
So
you
can
test
this
out
for
yourself,
you
can
make
some
nested
trees.
You
can
get
a
little
bit
more
complex.
A
You
can
see
you
know
how
do
you
write
those
different
strings
out
when
you
add
content
on
top
of
content,
and
you
can
try
writing
out
more
of
the
functionality
in
Ruby,
for
instance,
it
wouldn't
be
a
stretch
to
find
out
what
the
current
branch
is
by
writing.
Your
own
Ruby
commands,
knowing
now
where
those
things
are
stored,
that
shouldn't
be
overly
complex
and
letting
get
know
your
you
change.
A
Branches
is
another,
so
you
could
write
out
in
Ruby
or
your
scripting
language
of
choices
and
have
three
Ruby
demanding
stretch,
and
you
could
give
a
talk
demonstrating
this
to
others
would
get
knowledge,
so
that
is
the
bulk
of
the
content.
I
wanted
to
give
some
time
for
questions
and
I'm
going
to
post.
A
A
Yes,
yeah
I
would
assume
just
for
the
just
for
everyone
and
for
the
video
in
case
they
couldn't
hear
they're
using
chef,
and
he
was
wondering
if
you
could
use
some.
You
know
if
you
could
script
out
some
of
this
instead
of
using
the
Ruby
porcelain
commands,
I
would
probably
use
the
Ruby
porcelain
commands
just
to
stay
safe.
You
know,
because
there's
other
things
that
could
be
happening,
and
this
was
showing
that
a
very
simplistic
measure,
but
if
you
get
you
know
diving
deep
into
the
trenches,
you
could
miss
some
things.
A
You
know
scripting
out
your
own
I
think
it
would
be
a
fantastic
thing
to
try.
You
know
to
just
see
how
it
works
and
and
you'd
certainly
learn
a
ton
about
git
and
how
it
functions
in
Ruby
as
well.
You
know,
if
you
did
that
exercise,
but
I
would
I.
Would
I.
Certainly
do
not
do
anything
like
this
when
I'm
interacting
with
my
team,
you
know
in
repositories.
This
was.
A
This
is
more
of
a
you
know:
trot
dive
into
it
for
fun,
especially
for
you
know,
maybe
people
from
our
experience
teaching
people
get
like
people
who
are
in
the
new
to
intermediate
range.
You
know
they
understand
or
Stan.
The
porcelain
commands
pretty
well,
they
get
that
concept,
but
they
don't
really
know
how
anything
is
happening.
Underneath
I
think
it's
a
fun
exercise
to
dive
in
there
and
and
to
just
create
something
simple
like
this
just
so
they
really
internalize.
Oh,
it's
three
or
four
library
calls.