Jonas: So in this video,
we're going to put all our code on to GitHub.
Or as we usually say,
we're going to push our code to a remote branch,
so that we can
then set up the continuous integration feature
that I talked about before in the next video.
And so now here on GitHub,
let's click on this plus button here,
and create a new repository.
Or we could also click right here,
so there are going to be multiple ways
of creating a New repository
because that's basically the most important feature
on GitHub.
Am I right?
Then here, the first thing
is that we need to give the repository a name,
and I'm going to call it,
"fortify-course-video",
just so that I know exactly what this repository is about.
So I like to be really descriptive here.
Then, I'm going to make it private,
and so it is no one else can see this repository.
Then down here, we have the option to add a README
and a .gitignore, but we don't want to do that,
okay?
So if we added a README right now,
then we would create a conflict later on
when we import our code.
So actually, that's what's saying here right now,
so skip this step,
if you're importing an existing repository.
And so that's what we will do next.
So then click on creating repository,
(keyboard tapping)
and so here we are.
Okay.
So this year is the URL, basically of or a git repository,
but what matters here
is that now there are these two scenarios:
So there is the scenario
that we don't have a repository yet.
So I mean, a local one,
but that's not the case.
So we already have the repository
that we have been working on,
and so what we want to do now,
is to push that existing repository
to this online repository.
So to this remote repository
that we just created here.
And so in order to connect these two,
we need to copy this line of code
and execute it in or a local repository.
So let's go back, clear this here,
and then paste it and execute it.
And so what this did here, was to add a remote branch,
which is called "origin".
All right,
and the URL of that remote branch is called,
this one here.
So again, with this, we basically let
our local repository know about
this remote repository right here.
And if we check out our branches, now,
then that origin branch might actually be there.
Now I'm not sure if it is,
but let's check that out.
So git,
branch,
and it actually doesn't say here,
but that doesn't really matter.
So this was just to check.
But what matters is that we can now push code
to this remote branch, which remember is called "origin".
And, so the way we do that is
by writing git,
push,
and then the name of the remote brand,
which is called "origin".
So that's right here.
And of course, you could give this one another name,
but "origin" is simply the standard name.
So that's what everyone uses.
So git, push, origin,
and then the name of the branch
that you want to, to push.
(keybooard tapping)
And so let's say,
that we only want to push the master branch.
So, hit Enter,
and then you will see that it's going to do some work here.
And now it's done.
Okay.
And so now, if we go to GitHub
and reload, or repository here,
then,
then our code is there.
All right.
Great!
So we successfully pushed our local repository
into this remote repository.
And so now, if we would work on any other computer,
we could go ahead and take our code out of this repository.
And you see that indeed, all our code is here,
at least all the code
that we did not add to the Git ignore file.
So that's why you only have to source here now,
but not the dist and node modules folders.
But everything else is, of course, here.
So our index, HTML, and all our source codes.
And you can see here,
also, the commit messages that we had,
and you can see the branches.
So right now we only have the master branch,
but if we really wanted to keep that other branch as well,
in our remote repository,
then we can simply recall this again.
And so, .git-push-origin,
and then the name of that other branch,
which was called "new feature".
Now, right.
So ...
this looks a bit different,
but let's see, let's reload.
And then here it is.
All right.
But anyway, let's now add a readme file,
which is a common thing
that all GitHub repositories should have.
So it's basically a file that appears down here
with a description of the project.
So let's come here, or actually, let's do it from here.
So "touch, readme.md",
and so we can use or command line scales a little bit.
So, here it is.
And now to add a title to any MD file.
So "MD" stands for "markdown".
And so markdown, is like a special typing format
that we can use to write simple documents.
And so let's give this here a name of, "fortify, project",
and then, an empty line.
And then here, we can add some description text,
let's say,
"a recipe application with custom recipe uploads".
And so, you can write whatever description you want here.
I just want to keep it really short here.
And now, let's go through the same process, as before,
so that we can also upload this file.
So basically, upload this modification
to our remote repository as well.
So as always, we need to start
by adding this new file to the staging area,
then, we need to commit it.
So git commit message.
And then here a nice, descriptive, message.
So edit, the readme, and then git-push-origin, master.
So let's wait for it.
And now if we come here,
you see that we had, 26 minutes ago, we had two commits,
and this here is the latest commit message.
And now as we reload this,
then you'll see, we now have three commits.
This is the latest commit message.
And indeed, down here now appears,
this description that we just added.
Great!
Now, if you wanted to now start working on another computer,
you could simply go to this button here, copy this URL,
and then do the opposite, which is pull.
Okay.
Now, many times when we create a new repository,
we actually do it the other way around.
So, we start with a new repository on GitHub,
then we give it a name,
and then we actually add a readme here,
and also a git ignore, then we create that repository,
and then we pull that repo onto our computer.
And so this,
then actually, automatically connects the local repository
with the remote one.
And so that makes things a little bit easier.
So a lot of times I do it like this, but in this case,
we already had the local repository with all our code.
And so, therefore,
we needed to create this repository really empty.
So just the way that we did it.
Okay.
But anyway,
let's go back here to our remote Git repository now,
so that in the next video,
we can finally set up the continuous integration feature
with netlify.