In contrast to Git,
which is a local tool installed on your machine,
GitHub is a website.
This means you need to create an account,
then you can login, and then you can use GitHub.
Another difference between Git and GitHub is the fact
that GitHub is not for free for all use cases.
There is good news, though.
If we go to this pricing tab up here and there to plans,
you'll see that we have three different plans available.
And while this highlighted most popular Team Plan,
and this Enterprise Plan here are costly options,
so these are not for free,
we also have this Free Plan here to the right,
and, turns out, that this doesn't cost a thing.
The great thing is that the free plan is totally sufficient
for basic use cases, for basic single user use cases,
and also for smaller team projects.
And this means this plan, this free plan,
is totally sufficient for the purpose of this course
and also for you to get started with GitHub.
Therefore, what you can do now is,
you can go to join for free down here
or you'll scroll up and go to sign up.
There you then enter your email, a username,
and you select the password.
And with this, you create your GitHub account.
And if you then log into this account,
then you can see this page here.
This is your personal GitHub account page.
So to say, sort of page where you can manage
your GitHub account.
And before we dive a bit deeper here,
it's important to understand that by creating
this GitHub account, you now have a public GitHub profile.
So to say, so a profile, anybody can access.
You can, of course, manage what is displayed,
what is accessible on this page.
But you have this profile page.
And to access this page, you can simply go to this logo
up here in your right top part of the page,
and there you'll see your GitHub name that you used.
If you now take this name and add it
after he GitHub.com URL,
so, a slash and then the name.
So mloam in my case.
And if I go to this page,
then this is my both personal GitHub profile page,
which you can access now.
You see this page doesn't contain any public repositories.
We'll dive into what these are in a few seconds.
But, generally, this is the page of my GitHub account now,
and you also have such a page.
So this is the first thing to keep in mind,
GitHub comes with a public profile here.
As I said, we'll explore this in more detail
throughout this lecture.
First, I want to focus onto the way we can connect,
Git and GitHub now, because in this course,
we've worked on a local repository so far
where we added our branches and our commits.
And now the first goal would be to make sure that this
local repository is now also available here in the cloud.
Now, we have a big differentiation between repositories
managed locally on Git versus repositories
managed by our GitHub.
Git repositories are called local repositories,
GitHub repositories, so projects managed on GitHub,
are called remote repositories.
Remote because, well, they are basically accessible
from anywhere.
To establish the connection between these two repositories,
we need both a local repository and a remote repository.
This means in our case here,
we first have to create such a remote repository,
an empty remote repository, to be more precise,
here on GitHub.
And then we can establish the connection
between Git and GitHub to be able to bring
the local repository's content to this remote repository.
Now, lots of repositories here,
therefore, let's see how this works now,
by creating this remote repository.
We can do this either by selecting this
Repositories option up here,
there we could create a new repository over there,
or if we click onto this, well, GitHub symbol here
in the top left part of this page.
Then we are back on the page we saw
when starting GitHub the first time.
There you can create the repository by clicking
onto this new button.
By the way, don't get distracted by this repository.
You can see right here this is not related
to this module of the course,
so you can simply ignored this.
So let's click onto New.
And here we can now create a new repository.
As I said, repository here refers to a remote repository,
so a repository on GitHub.
First, we have to give this remote repository a name here.
I'll simply call it web-dev-github, maybe.
There you also get the confirmation
that this repository name is available.
We could then add a description
about what this repository contains.
This is optional, though.
Therefore, we'll omit this for the moment.
Afterwards, we have the option to choose
between a public repository and a private repository.
If you think back about the profile page, I just showed you,
so this public page you have when creating GitHub account,
then public repositories would be visible there,
private repositories, wouldn't.
So for private repositories,
it's up on you to decide who sees
and who can interact with these repositories.
For public ones, at least,
the visibility part is set by default.
Anybody can see this repository and the code it contains.
So be careful,
but to choose right here for the purpose of this course,
we have nothing to hide.
So we could say this is kind of an open source project
anybody can see, therefore we'll go with the public option.
And afterwards, we can initialize the repository
with some other options to be selected.
These are not related to the core concepts
of Git and GitHub, therefore, we'll keep this boxes unticked
and simply create a repository
with this screen button here at the bottom.
Now, this takes a few seconds.
And with this, the repository was created.
In here we now have multiple options on how to continue.
One option right here would be to create a new file.
At the moment, what we basically have
is an empty project folder,
so to say, not containing any data.
Therefore, we could add data to this remote repository
as one option.
For us, as we have a local repository
already on our machine, this is not what we want to do.
Our next step would be to push an existing repository
from the command line.
Let me scroll down a bit.
Now, pushing simply means bringing the repository content
from the local environment, from the local repository,
to the public one which has created.
To be able to do this,
we need to apply three different commands
or, to be a bit more precise here, two commands,
because this command here is just about renaming a branch.
We don't have to do this.
Our branch names are right already.
Therefore, we only need to run this command here
and this git push command.
What are these commands about, though?
Well, git remote here, this one, or git remote add,
simply tells Git to add a connection to a remote repository,
the remote repository, which has created.
And to be sure that Git knows the location or the address
of this repository, we need to add the URL.
So right here, this is the URL of our remote repository.
This URL can also be found up here, by the way.
Ahead of the URL, we also have this origin keyword.
Origin is a standard naming convention,
so you could also name this differently.
I don't recommend this, though.
And origin is simply the shortcut of this URL.
So, of this URL here.
This means, by adding this remote connection
with this command,
Git knows that origin refers to this remote repository.
And therefore, when running other commands,
little hint down here,
git push also contains this origin keyword,
simply means that we only have to add origin
and not the entire URL all the time.
So that's basically this git remote add origin command.
With this command,
we can now simply copy the URL up here, by clicking there,
and now we can go back to our local repository.
So back in the project and what I want to do first,
this is not required, by the way,
I just want to make sure that we are all on the same page,
is I want to go back to our main branch
because, currently, at least in my case here,
if I run git branch, you see that I am in the delete branch.
And I don't want to have this branch in here
in this remote project.
Therefore, I'll switch back to the main branch,
and now delete the delete branch to only have
this main branch to get started with GitHub.
So let's delete the delete branch by running
git branch -D delete.
With this, the branch has gone and now we only have
the main branch left, and we are in this branch.
Now what I'm going to do is I want to establish a connection
between our remote and our local repository.
This can be done by the command
we just talked about on GitHub.
So, git remote add.
So add a remote connection to what?
The origin remote repository.
And what is the origin remote repository?
Origin is just URL.
We can now paste. It's the one we just copied.
And by confirming this with enter, nothing happened.
This is of course not true because now,
our local repository is connected to the remote one.
Now we only have to tell our local repository here
that we want to bring this local code
to the remote repository.
And this can be done with another command.
So let's go back to GitHub quickly.
And this is the third command here,
git push origin name, -U can be omitted.
It's about so-called upstreams,
which are not relevant for us at this stage.
So git push simply means, bring the code from the local
to the remote repository. And to which repository?
Well, to the one with the origin name.
So referring to this URL in a lower case.
And they're into the main branch.
So let's see if this works. So we go back.
And I'll run, git push origin main.
And by executing this command now,
we get a warning, so to say, or a pop-up
with the information that the extension
GitHub wants to sign in, using GitHub.
Well, what's going on right here now?