►
Description
In this edition of Labs and Latte, Matt dives into Part 1 of our "Introduction to Git" series, which covers your first experience with Git, setting up a repository, and working with Git configurations.
If you want to follow along, you can play with this lesson right now at https://go.nrelabs.io/labs/?lessonSlug=git-version-control&lessonStage=0
Video Series:
- Part 1 - https://www.youtube.com/watch?v=YAXWxA4x8vs
- Part 2 - https://www.youtube.com/watch?v=b203WRT_hIg
- Part 3 - https://www.youtube.com/watch?v=mOj7kCfu7TY
- Part 4 - https://www.youtube.com/watch?v=qOmQzUR5t0E
- Part 5 - https://www.youtube.com/watch?v=Bqtk0wpgl4A
A
It's
one
of
my
favorite
cold
brews
I'm,
not
a
huge
cold
brew
fan
I
used
to
be
a
lot
more
of
a
fan,
but
I've
started
to
make
more
lattes
and
macchiatos
and
straight
espresso
shots
lately,
as
I
acquired
a
new
espresso
machine
a
few
months
ago,
however,
I
digress.
This
is
the
first
edition
of
labs
in
latte,
and
this
is
a
video
series.
A
I'm
kicking
off
to
dig
into
very
specific
topics
related
to
automation
and
other
things
within
the
NRE
labs
curriculum,
because
I
think
that
they
warrant
further
sort
of
for
further
exploration
and
on
this
first
edition,
I'm
very
excited
because
I'm
going
to
be
talking
about
get
now.
Quick
aside
on
git,
if
you're
not
familiar,
it
is
a
version.
Control
system
version
control
systems
are
it's.
It's
a
it's
a
tool
that
software
developers
have
used
for
a
long
time.
A
Basically,
if
you're
working
on
software,
one
of
the
things
that
you
want
to
be
able
to
do
is
know
when
certain
changes
were
made
by
who
and
ideally
provide
a
way
for
multiple,
or
rather
a
team
of
people
really
to
do
that
in
a
distributed
fashion.
I
mean
some
version
control
tools.
Do
it
in
different
ways.
Git
is
what's
referred
to
as
a
distributed
version
control
system.
A
What
we're
gonna
start
with
today
is
just
the
very
fundamentals:
let's
create
our
first
git
repository,
so
I'm
gonna
go
through
this
lesson
and
we'll
walk
through
step
by
step
so
as
as
it
shows
in
the
lesson
some
of
what
I've
said.
There's
this
is
a
tool
that
software
developers
have
been
using
for
a
long
time
to
improve
the
way
that
they
manage
changes
to
their
code.
So
it's
not
just
about
managing
changes.
It
allows
you
to
collaborate
with
folks.
It
allows
you
to
undo
changes.
A
For
instance,
if
you
liked,
if
you'd
like
to
roll
back
a
change
that
maybe
didn't
go
the
way
you
thought
it
would
it's
very
useful
now
as
I
as
is
mentioned
in
the
lesson,
there's
absolutely
nothing
about
git
or
virgin
control
in
general.
That
requires
you
to
be
a
software
developer
and
I
think
this
is
a
really
important
point,
because
I
think
this
is
one
of
the
reasons
why
git
has
become
so
ubiquitous
and
you've,
probably
heard
of
things
like
infrastructure
as
code
or
or
get
ops
things
like
that.
A
You
know
your
storage,
arrays,
programmatic,
API,
whatever
it
is,
these
are
all
text
files,
that's
all
they
are,
and
so,
even
though,
in
in
the
most
popular
case,
a
tool
like
git
is
used
as
a
version
control
tool
for
software
developers
to
manage
massive.
You
know,
Java
code
bases,
there's
absolutely
nothing
about
git.
That
means
that
you
have
to
use
it
that
way,
if
you
just
want
to
manage,
say
a
bunch
of
the
amyl
files
or
ginger
snippets
or
even
just
straight-up
network
configurations,
just
as
text
files,
that's
totally
fine.
A
Git
is
not
opinionated
on
that
at
all
and
I
think
that's
one
of
the
reasons
why
it's
becoming
so
popular
in
the
infrastructure
space,
because
it's
not
very
opinionated
in
that
way.
So
this
is
gonna,
be
a
multi-phase
lesson.
I'm
not
going
to
go
over
everything
in
this
video.
There
will
be
following
videos
for
the
for
the
next
few
chapters
in
this
lesson
in
this
in
this
chapter,
what
I
want
to
go
over
is
what
is
a
git
repo?
You
keep
hearing
this
term,
get
repo
or
repository.
What
is
it?
Let's
create
one?
A
Let's
have
our
first
experience
with
one
and
let's
walk
through
some
of
the
options
that
that
gives
us
now
when
you're
in
when
you're
in
this
lesson,
if
you
want
to
follow
along
by
the
way,
go
to
any
labs
IO
and
go
to
the
lesson
catalog,
it's
just
titled
introduction
to
get
and
you'll
get
the
exact
same
screen
that
I'm
getting
please
follow
along
if
you
like,
so
the
very
first
thing
that
we
want
to
do.
We
have
a
linux
shell
here,
it's
just
a
Linux
container
that
allows
us
to
run
commands.
A
So
the
first
thing
we
want
to
do
is
we
want
to
make
a
new
directory
and
if
you
are
familiar
with
Linux,
that
command
is
mkdir
space,
my
first
repo
and
then
we
can
also,
let's
just
run
that
and
if
you
like.
Obviously
you
don't
have
to
type
anything
if
you'd
like
to
I'm
just
gonna
type.
What's
in
these
snippets,
if
you'd
like
to
just
click,
run
snippet,
you
can
absolutely
do
that.
So
we
go
into
that
directory.
This
is
just
a
plain
old
directory.
There's
nothing
in
it!
Nothing
in
this
directory!
A
What,
when
you
when
you,
when
you're
thinking
about
a
git
repository,
think
of
it
as
a
container
for
things
that
get
needs
to
know
about,
and
so
in
order
to
start
that
process,
you
need
to
initialize
a
new
repository,
so
you
could
think
of
a
repository
as
nothing
more
than
a
directory
that
you've
told
get
to
start
tracking
and
the
way
that
we
do,
that
is,
you
say,
get
in
it.
So
this
just
initializes
a
new
git
repository
and
it
says
it's
empty.
There's
a
it
doesn't
know
about
anything
in
this
directory.
A
There's
nothing
in
the
directory
to
know
about
anyway.
What
it
did
was
it
created
a
directory
called
dot,
get
within
that,
and
you
can
even
look
at
some
of
those
files
if
you'd
like
I'm,
not
gonna,
go
into
detail
on
these.
In
this
lesson,
if
you'd
like
to
go
deeper
with
git,
there's
a
lot
of
resources
out
there
that
dive
into
these
details,
specifically
I'm
just
gonna
sort
of
help,
you
get
your
first
repo
off
the
ground
for
now,
but
that's
basically
what
we
did
so
other
than
that.
There's
nothing
in
this
in
this
directory.
A
All
we've
done
is
we've
initialized,
the
git
repository
which,
for
our
intensive
purposes,
is
a
directory
with
a
dot
git
directory
inside
of
it,
and
so
that's
it
that's
our
first
kit
repository
now.
Obviously
we
want
to
be
able
to
do
stuff
with
it.
So
the
first
thing
is:
we
need
to
know
how
to
configure
gifts,
so
git
needs
to
know
a
few
things
before
we
get
started.
There
are
a
few
things
that
get
needs
to
know
about
us
and
about
the
repository
we're
creating
now.
A
Normally,
the
way
that
you
configure
get
is
through
a
file
at
your
you
in
your
user
directory,
and
you
can
see
we
we
can
cat
that
file
here,
but
it
doesn't
exist
and
the
reason
is
we
haven't
told
get
about
us
or
about
any
anything
about
our
desired
configuration.
So
if
you
scroll
down
you'll
see
that
there's
a
new
command
called
git
config
now
this
command
basically
just
says:
look
I
want
to
create
our
source
set,
a
sort
of
a
variable.
A
If
you
will
it's
a
way
of
telling
it
about
a
specific
aspect
of
its
configuration
now
in
this
example,
you
can
see
the
two
things
that
we're
going
to
be.
Configuring
is
our
email
address,
and
our
name
now
I
want
to
take
a
quick
aside
on
this,
because
it's
important
in
this
day
and
age,
especially
if
you're
going
to
be
working
with
github,
to
provide
this
information.
But
the
very
first
thing
it
needs
is
your
email
address
and
your
username.
Now
these
don't
actually
have
to.
A
If
you're
talking
about
get
these
don't
actually
have
to
be
correct.
You
can
put
anything
in
here.
You
want
when
it
comes
time
to
something
like
github,
which
we'll
cover
in
a
future
version
of
this
lesson,
github
actually
uses
this
email
address
to
track
to
make
sure
that
the
when
you
push
commits,
which
we'll
get
into
later
into
github,
that
it
gives
you
credit
for
those
things,
and
so
I
would
encourage
you
to
use
the
correct
email
address
you
don't
have
to.
A
But
if
you
do
use
the
correct
email
address
and
you
link
it
to
your
github
profile,
you'll
get
credit
for
the
commit.
So
when
you
do
this
configuration
I
would
recommend
doing
it
with
a
with
a
correct
email
address.
But
if
you
don't,
if
you
have
no
intention
of
working
in
github-
and
you
just
want
to
work
locally,
it
really
doesn't
matter
what's
in
here,
so
you
set
your
user,
your
user
email
and
then
your
username,
those
are
sort
of
like
the
the
keys
for
the
variables
that
you're
about
to
set.
A
So
if
you
type
git
config
now
the
flag
global
I
want
to
I
want
to
take
a
quick
aside
here
as
its
mentioned
here
in
the
lesson,
there
are
a
few
different
scopes
for
these
configurations
to
take
place.
You've
got
your
local
scope,
so
meaning
the
the
configuration
option
that
you're
setting
is
only
applicable
to
this
git
repo.
So
if
you
created
another
git
repo
in
a
different
directory,
the
configuration
options
that
you're
applying
here
would
not
exist.
They.
Those
options
would
only
be
specific
to
that
repo
going
up
a
level.
A
So
what
that
means
is,
if
you,
if
you
create
configuration
options
at
that
scope,
then
any
git
repo,
that's
that's
that's
created
or
managed
by
the
current
user
will
have
those
configuration
options
and
then,
finally,
the
very
highest
scope
is
the
system
scope.
This
is
a
config
placed
within
the
on
Linux.
It's
slash,
Etsy
I,
don't
know
what
it
is
on
Windows,
but
I.
Imagine
it's
something
similar.
Basically,
this
is
an
option
for
all
repositories
on
the
system,
regardless
of
the
user.
A
I,
don't
see
that
option
used
very
much
usually
get
is,
is
something
that
you
deal
with
on
a
per
user
or
a
per
repo
basis.
So
the
global
and
local
scope
are
much
more
important
now
as
I'll
as
I'll
explore
a
little
bit.
These
scopes
do
override
each
other,
so
local
overrides
global
and
global
override
systems.
So
if
you
have
local
options,
those
overrides
similar
options
in
other
scopes,
so
git
config
globe
will
do
this
at
a
global
perspective.
This
is
pretty
common
again.
Global
scope
is
done
for
all
repositories
of
the
current
user.
A
So
it
kind
of
makes
sense
that
the
that
the
that
those
two
options
for
username
and
for
your
name
and
for
your
email
address
are
done
at
the
global
scope.
So
we'll
do
that
here:
oops
there
we
go
user
dot,
name,
oops,
I
scroll
down
way
too
far.
Let's
keep
track
of
where
we're
going
user
name,
Jane,
Doe
cool,
and
then
we
can
do
up
and
backspace
to
do
user,
dot,
email
and
we'll
say
Jane
at
NRI.
Labs
done
I,
oh
cool!
A
So
now,
if
you
look
at
that
file,
which
we
saw
earlier
so
that
dot
get
config
in
our
user
directory,
so
you
do
cat
will
do
CD,
but
you
know,
let's
just
stay
in
the
directory
and
we'll
just
use
the
absolute
path
cat
get
config
just
to
keep
things
simple.
You
can
see
that
there's
contents
in
this
file.
Now
we
didn't
actually
edit
this
file
ourselves.
You
can
see
further
up
that
further
up
when
we
apologies,
my
phone
just
went
off.
A
You
can
see
further
up
when
we
when
we
actually
tried
to
look
at
the
contents
of
this
file.
It
didn't
exist
so
simply
by
adding
these
two
commands
get
config.
With
these
two
options,
you
can
see
that
the
the
file
is
automatically
created
for
us
and
formatted
the
way
that
get
likes
it.
So
we
don't
have
to
deal
with
the
file
ourselves.
We
just
work
through
get
so
that's
great.
A
Now,
if
you
want
to
look
at
the
config,
obviously
we
can
look
at
the
file,
but
if
in
case
the
file
is
huge,
some
some
git
configs
can
be
can
be
large.
You
can
also
look
at
git
config
with
the
flag
list
and
of
course,
if
you
want,
you
can
specify
the
global
scope
and
it'll
tell
you
those
options
in
a
succinct
format
there.
Now,
as
I
mentioned,
these
different
scopes
can
override
each
other.
A
So
if
you
have,
let's
say
somebody
on
a
system
where
they're
interacting,
where
they're
logged
in
as
a
certain
user
may
be
some
sort
of
an
admin
user
of
some
kind
like
a
service
account-
or
you
know,
they're
logged
in
on
behalf
of
somebody
else,
but
they
want
to
make
a
commit
as
them.
So
basically
there
a
different
user
for
this
repo.
Then
there
is
four.
Then
there
is
for
the
the
system
or
the
the
logged
in
user.
You
can
actually
override
that.
A
So
when
we
specify
get
config
and
do
not
pass
a
scope
flag,
it
defaults
to
local.
So
we
can
actually
say
user,
email
and
we'll
say
a
totally
different
user
email
here
at
NRA,
labs,
IO
and
we'll
do
user
dot
name
Jimmy
do
now
again
again:
local
overrides
global.
So
if
we
do
get
config
well
we'll
do
list
and
we'll
leave
global
out.
You
can
see
that
the
new
user
name
here
is
a
gym
at
NRI,
lab
CO
and
Jimmy
doe.
A
Now,
if
we
add
the
show
origin
flag
on
top
of
that,
you
can
see
where
these
different
options
actually
originated
from
so
local,
the
local
config
takes
precedence.
So
that's
why
it's
here
on
the
bottom,
you
can
see
all
the
options
that
are
here
in
the
local
config.
The
global
config
is
up
here
as
well,
but
again
because
local
overrides
global.
These
options
aren't
actually
in
use
for
us,
while
we're
in
this
repository
so
very
important
to
keep
in
mind
so
yeah,
and
that
is
that
is
sort
of
it.
A
So,
to
recap,
the
three
commands
that
we
learned.
We
have
git
init,
which
is
initialized
as
a
new
git
repository,
so
you
have
a
directory.
Let's
say
you
have
some
files
in
in
that
directory,
which
we'll
cover
in
the
next
video
you
create
get
in
it
and
what
that'll
do
is
it'll
tell
git,
hey
I,
want
to
initialize
a
new
repo
here
and
that's
the
very
first
thing
you
have
to
do
before.
You're
allowed
to
do
anything
else,
and
if
you
have,
if
you
don't
have
a
git
repo,
you
don't
have
anything.
A
So
that's
the
first
thing
the
git
config
command
allows
you
to
both
read
and
write
to
the
configuration
at
any
one
of
those
three
scopes
and
again
to
remind
you.
Those
are
global,
or
rather
at
the
at
the
bottom.
Local
is
the
most
important
most
most
precedent,
and
then
you
have
the
global
scope,
and
then
you
have
the
system
scope
and
it
finally
looks
like
we
don't
have
git
show
in
this
lesson.
So
this
is
a
little
mistake
and
a
lesson
guide,
so
that'll
get
fixed,
get
show
just
to
spoil
it
a
little
bit.
A
Why
not
it's
a
way
of
looking
at
a
specific
thing
and
get
so
like
if
you
make
a
commit
or
if
you
wanted
to
look
at
say
some
some
other
reference
and
get
you
can
do
git
show
to
take
a
peek
at
it,
but
more
on
that
in
the
next
lesson.
For
now,
though,
this
is
it
for
labs
and
latte
finished
that
coffee
and
let
us
know
what
you
think
about
NRI
labs
enter.
Your
labs,
of
course,
can
be
found
at
any
labs
I/o.
If
you
want
to.