- [Instructor] Whether you're a professional,
or an amateur developer,
you most definitely heard
about the concept of version control.
There are tons of tools in the market,
both commercial and open source.
And usually you will find things
like the version control system or VCS,
or SubVersion for example,
a concurrent version system or CVS,
Team Foundation servers.
And there are tons and tons
and tons of other ones out there.
However, there's one that in particular
is extremely popular nowadays,
and that is Git, right?
And you probably have heard of Git
because of GitHub, right?
Or GitLab.
And GitHub is basically, you know,
a product or an ecosystem
that was actually acquired by Microsoft.
And GitLab is actually the community base, you know,
I would say open source, you know, repository.
However, what I want to actually explain
is the concept of Git,
and how to actually interact
with things like GitHub and GitLab,
or private repositories,
and so on, right?
Now, Git is open source software.
You can actually download it
from the link that I'm highlighting on the screen.
However, if you're a Linux user,
you may already have Git out the box,
you know, install in your system.
Or you can actually install it
in operating systems like Debian or Ubuntu
with a simple apt-get install git, right?
Or equivalent, depending on the distribution.
But what I want to actually go over
is a few basic commands
that you actually have to know for the exam, right?
For example, you know,
to create an empty Git repository
in a specific directory,
you can actually just run git init, right?
And that with no arguments will initialize
the current directory as a Git repository.
However, you can also do git init,
and then specify the directory itself.
You also have git clone,
and that clones the repository
located in a specific, you know, in a repo,
whether it's GitHub or GitLab,
or a private GitLab repository, and so on.
You also have configuration parameters.
And it's actually, you know,
those are actually set up
by the git config command, you know,
that you can actually use
for things like defining the author name,
and setting global configuration flags,
setting even your GPG or PGP key
to sign your commits, and so on.
You also have the git add command,
that stages all the changes in the directory
that you actually initiated for the next commit.
And then, you also have the git commit command,
that basically commit the stage snapshot,
but instead of actually launching a text editor,
you can actually use the -m for the message,
and that will actually, you know,
each commit will actually have to have
at least some description
of what the commit is all about.
And that's actually the message in this example.
Now you also have the git status,
which actually list which files are stage,
unstage, or untracked.
You have logging capabilities.
And to display the entire commit history,
you can actually use the git log.
You can also use the git diff
to show the unstage changes
between your index and your working directory.
Now there's a concept of branches, of course,
in many development, you know, activities.
And to list all the branches in your repository,
you can actually use the git branch command.
And to check out,
or create a new branch,
you can actually use the git checkout
followed by the branch name.
There's also the concept of merging
and pull request, right?
So if you actually want
to push a new change to a repository,
you can actually do a git push, you know,
to push that branch, or you know,
that change to a remote branch,
whether it's the master branch or a specific one.
Or you can actually do a pull request,
and basically what it does
is fetch the specify remote copy
of the current branch,
and immediately merges to a local copy.
And then it actually, you know,
provides the ability
for you to then pull request.
And a pull request,
then it's approved by whoever the administrator,
or the specific user of, you know,
the author of that GitHub repository.
Now, if I actually want to obtain information,
things actually changes in that repository,
and keep up to date,
I can do a git fetch, right?
To fetch a specific branch,
or, you know, pretty much everything
if you actually want to fetch all the remote references.
And then you can do a git pull
to fetch the specified remote copy
of the current branch,
and immediately merge it
to your local copy as well
to keep track of those changes, right?
So of course, as you actually make changes,
you can actually use the commands
that I mentioned to you before,
like git add, and git push
to push any changes to a specific branch,
or to the master branch in that case.
Now the cool thing is that,
DevNet has several labs
that you can actually complete in your own.
And in there, they not only provide
an introduction to Git,
but also, there's several repositories.
Like for example,
they have DevNet Express for DNA,
cloud collaboration, data center infrastructure,
that actually you can clone,
and then use for your reference,
and also, you know,
to practice your skills as well, right?
So definitely take advantage
of all these labs and tutorials
that are available for free
from Cisco at DevNet.