►
From YouTube: The Battle for Sub-premacy - Git Merge 2017
Description
Submodules or Subtrees? Both are proposed by Hector Alfaro and Kyle Macey as solutions for handling dependencies with Git. In this session the gloves are coming off, which one will win it all?
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
Because
with
sub-modules
we
have
a
separate
history,
you
can
continue
treating
that
sub
project
as
a
separate
project.
Altogether
you
can
usually
you
can
fairly
really
push
changes
back
to
that
sub
project
and
it's
more
easily
configured
I
think
we
lost
the
slide
there.
Just
give
that
a
second
full
page,
a
word.
A
All
right
so
there's
a
repo
under
Kyle's
account,
so
it's
Kyle,
Macy,
/
parent
product
demo,
there's
a
repo
under
my
account,
which
is
a
Hector
sector,
carrot,
project
demo
and
then
there's
a
reap.
So
those
are
going
to
be
the
parent
projects
and
then
we're
going
to
be
using
the
sub
project
under
github
schools.
Last
sub
project
demo
give
you
a
chance
to
get
those
and
I
just
have
to
accept
Kyle's
invite
very.
C
C
A
All
right,
so
we've
got
so
Kyle
will
be
over
on
the
left,
want
to
take.
Read
that
can
do
read.
How
will
do
read
I'll,
take
the
right
side
and
I'll
do
the
subtrees
on
the
right
side.
That
way,
it's
consistent
with
some
models
versus
subject,
so
the
first
step
that
will
run
through.
Could
you
fund
the
project
it
that
yeah
okay,
so
the
first
step
will
run
through
is
will
clone
those
projects
down?
Just
like
you
all
probably
did.
D
A
C
A
Okay,
so
in
the
case
of
a
sub
tree,
we
need
to
it's
a
little
bit
of
a
more
complex
command,
just
because
we
need
to
identify
how
exactly
we
want
to
incorporate
the
sub
projects.
Changes
I'm,
going
to
run
here
to
my
sub
tree
example,
and
so
the
command
is
get
sub
tree
ad
and
then
this
prefix
is
going
to
be
how
we're
going
to
refer
to
the
sub-project.
A
C
A
C
A
C
C
C
C
C
So
just
command
C,
okay
and
command
V
and
oh,
it
has
a
little
flex
yeah.
We
don't
need
that.
Aha,
there
we
go.
We
have
a
tip
from
our
sub
module
like
a
real
software
developer.
So
what
you
have
to
do
that
kind?
Why
did
I
have
to
do
that?
Because
the
entire
staging
areas
and
get
indexes
or
indices
are
different
between
the
parent
project
and
the
sub-project
inside?
So
what
you
do
see
in
there?
C
If
we
were
to
go
in
and
try
to
commit
here,
we
would
actually
be
committing
to
the
sub
project
and
not
to
the
pantry,
but
so
we
run
get
zip
inside
the
sub
module.
We
can
see
the
addition
there
and
what's
really
nice
about
this-
is
that
we
can
write
a
very
clear
commit
message,
because
that's
how
we
let
our
we
let
our
co-workers
know
what
sort
of
things
we
did
and
if
we
go
back
up
to
the
parent
project.
C
C
We're
getting
even
lazier
know
quote
that
time,
all
right,
so
that's
kind
of
how
I
would
make
changes
and
commit
them
in
in
my
sub
project.
It's
a
couple
steps
at
the
do
two
commits
one
in
each
project,
but
do
you
have
to
do
like?
How
do
you
do
it
in
your
sub
projects
thing
their
sub
tree
sub,
trees.
C
A
A
D
C
D
C
C
Apparently
we
have
different
definitions
of
important,
but
that's
fine,
so
you
can
admit
on
yours.
Do
you
have
any?
So
you
said
like
it's
all
one
project
now,
so
it
kind
of
feels
like
it's
just
one
repository,
but
maybe
you
need
to
update
that
sub
project
back
on
github,
right
that
separate
repository
that
you
added
in
there
yeah
from
my
understanding.
This
isn't
something
you
would
typically
want
to
do
now.
A
A
C
B
B
D
B
C
Two
sub
modules
for
pushing
up
that
sub
module
well
I
could
either
I
have
options.
I
could
either
CD
into
my
sub
module
and
I
could
actually
run
get
push
from
here,
but
I
also
have
this
fancy
command
I
can
run
from
the
parent,
because
that's
what
you
did
I
feel
like
I'm
keeping
up
with
the
Joneses
here.
I
can
pet
do
get
push
with
this.
Recurse
sub-modules
equals
on-demand,
and
what
this
does
sound
like
a
curse
word.
It
is
if
you've
ever
worked
with
sub
modules.
C
This
push
is
both
to
commit
from
my
parent
project
and
em
from
my
sub
module
as
well.
So
if
I
run
this
here,
it's
actually
going
to
push
two
things
and
you
can
see
that
there
it
looks
kind
of
like
doubled
up,
but
we
can
see
that
we
ran
both
the
sub-project
got
pushed
up
and
then
underneath
that
the
parent
project
got
pushed
as
well.
So
if
I
go
into
the
web
browser
and
look
at
how
me
see
parent
project
demo,
I'd
screwed
it
up
tonight,
you're
doing
the
same
thing
this
time,
I,
don't.
C
A
C
C
C
C
B
D
C
Commit
directly
to
master
I
like
to
have
a
radio
button,
so
you
can
really
own
up
to
it
all
right.
So
if
I
want
to
pull
in
these
updates
here
again
kind
of
like
with
pushing
I
can
either
CD
into
that
sub
project
and
get
pull
in
there.
But
that's
no
fun.
We
would
like
to
do
get
sub
module
update,
there's
a
nice
little
little
command
there.
C
C
C
Can
see
it
so
if
we,
if
we
go
into
that
sub
project,
we
see
you
around
master
here
and
we
run
git
log
inside
of
here.
We
can
see
that
remove.
Ray's
call
has
been
pulled
down
from
github
and,
as
we
expect
here
in
our
parent
project,
we
run
git
status.
That
sub
projects
has
been
committed
to
so
a
little
bit
tedious
here,
but.
A
A
B
A
A
So
you're
combining
two
history
and
I
think
when
you're
pulling
it's
a
little
bit,
that's
better
than
easier
case
to
make.
If
you're
doing
a
good
sub
tree
pull
versus
a
good
subtree
push,
but
it
is
harder
to
kind
of
maintain
that
that
separate
history,
when
it's
all
part
of
your
your
parent
project,
absolutely
did
it.
Yes,
okay,
so.
A
So
we
can't
I
just
wanted
to
walk
you
through
those
scenarios
of
having
a
parent
project
having
a
sub
project
in
both
the
sub
module
case
and
the
sub
tree
case.
Hopefully
that
helped
to
clear
up
if
there
was
any
confusion
at
all
or
at
the
very
least,
helped
form
a
comment
below
you
can
use.
So
thanks.
D
B
C
It
would
have
been
a
good
one
to
add
into
our
thing
here.
Well,
with
the
sub
module
at
least
I
can
I
can
speak
to
a
little
bit
set
because
you're
kind
of
maintaining
it
as
a
separate
project.
It
would
work
very
similarly
as
if
you
were
pulling
down
in
a
single
git
repository
it'll,
either
tell
you
to
stash
or
abort
changes
or,
if
you're
trying
to
do
a
git
merge
you
run
into
conflicts
there.
C
A
With
a
sub
module,
there's
also
that
option
of
how
you
want
to
bring
in
those
changes,
so
Kyle
chose
the
merge
option.
He
could
have
instead
checked
out
that
comment
instead
of
merging
it
so
and
there's
a
potential
merge
conflict
to
get
a
bypass
fit
that
way
or
at
least
look
at
it
before
the
merge
conflict
occurred
in
the
case
of
subtree,
because
I'm
really
just
adding
and
squashing
and
having
that
committed
again,
it
would
just
be
a
matter
of
resolving
a
standard
Marylin.
C
Yeah
so
I
think
like
like
we
showed
here.
If
you
have
like
it's
a
module
that
you
want
to
or
a
sub
project,
you
want
to
use
as
like
a
dependency
that
you
what
you
want
to
updating
and
track
changes
from,
maybe
use
it
across
several
projects.
I
think
you'd
want
to
lean
more
towards
the
sub
module
route
it
actually
even
better
than
that
you
might
want
to
use.
C
You
know
a
dependency
manager
but,
and
then
in
the
case
where
you
want
to
kind
of
like
combine
those
histories
and
treat
it
as
one
project,
you
know
kind
of
maybe
not
do
as
much
development
on
that
separate
sub
project.
I
think
you
would
want
to
move
towards
the
sub
tree
ro.
One.
A
C
A
little
bit
of
a
here
be
dragons
as
well
too
is
some
modules
can
get
a
little
bit
weird
too,
with
kind
of
keeping
branches
in
sync
between
your
parent
project
and
your
sub
module
project.
So
you
guys,
you
have
to
be
a
little
bit
proactive.
You
can
actually,
in
your
get
modules
configuration
you
can
kind
of
tell
it
to
track
certain
branch
from
the
parent,
which
is
something
I
would
recommend
doing.
Otherwise
you
could
end
up
with
a
clone
of
the
project
without
the
proper
sub
modules
underneath.
C
By
default,
most
of
the
sub-module
commands
will
actually
only
go
a
depth
of
one
I
think
you
may
have
seen
admit
was
the
whole
command
that
I
did.
There
was
a
for
cursive
there
and
that'll
tell
it
to
go
all
the
way
down.
I,
don't
know
off
the
top
of
my
head.
We
can
check
Stack
Overflow
again,
if
you
want,
if
you
can
specify
a
level
of
depth
down.
C
C
I
have
not
personally
seen
that
many
at
once
I
in
fact
working
with
some
of
the
companies
that
I've
worked
with
as
a
services
engineer.
Without
the
tools
part
I've
encountered
people
that
I've
had
to
use
subtrees
to
kind
of
just
merge
like
a
single
project
history
into
another.
Some
have
used
it
to
like
migrate
from
another
version.
C
Control
system
and
they'll
only
bring
over
like
the
most
recent
commits
at
first,
and
then
they
will
use
a
subtree
to
kind
of
bring
over
like
a
full
history
later
so
xing
kind
of
flip
into
production
sooner
was
that
that's
kind
of
an
interesting
set
up
in
and
of
itself,
but
as
far
as
I
don't
think,
I've
ever
seen
more
than
two
or
three
sub
trees.
As
far
as
sub
modules
go,
I
can't
think
of
any
examples
off
the
top.
My
head
I
think
maybe
Cordova
I,
don't
remember.
C
There's
a
few
projects
that
I
have
like
a
whole
slew
of
sub
modules
inside
out
and
they'll
use
it
as
a
as
a
dependent
dependency
manager.
I,
don't
think
it's
quite
OVA
and
load
everything
in
that
way.
But
in
that
case,
I
would
definitely
try
to
opt
for
something
you
know
like
Tumblr
or
NPM,
or
something
like
that
for
a
grab.
Those.
C
Yeah
little
bit
separate
there
yeah
and
you
know,
certainly
put
some
strong
consideration
to
before
you
start
adding
a
bunch
of
sub
trees
into
our
projects,
because
you
may
end
up
kind
of
like
bloating
out
a
parent
repository
like
you're
kind
of
moving,
then
towards
those
a
monolithic
repository
styles
and
if
you
end
up
doing
that
and
getting
into
trouble
with
that
later
today,
I'll
be
talking
about
how
to
reduce
repository
sizes,
which
is
good
LFS
and
the
BFG
repo
cleaner.
Yes,.