Hi, everybody, and welcome again.
Today, we're going to discuss a new topic, which is GitHub and version control.
Before beginning, I just want to say a few words about GitHub and what they are.
GitHub provide cloud services, same as Google Drive.
In Google Drive.
We can upload videos, photos or documents.
And then whenever we need them, we can download them back to our computer.
Programmers worldwide are using GitHub for the same purpose, but not for just files or documents.
They're using it for their programming projects.
OK, and using GitHub, we can control our projects and can make them safe from upcoming changes, constant
changes that can be made by programmers.
For example, I have a working project, a working website project that I've built and currently everything's
fine.
It works fine.
So I'm uploading it to GitHub.
And then someone from my team made some changes that made the project to be broken and corrupted.
And sadly, nothing is working in the project.
But that's all right.
Nothing happened because I uploaded I've uploaded the working stable code to GitHub, which it sits
there safe and sound with nothing can happen to it.
And the corrupted code will appear only at the programmers computer specifically.
And by using GitHub, I can revert the code to that programmers computer to the stage where it when
it was working.
OK, so if someone off the team of programmers corrupts the code, he can always revert back to the
time where the code was working.
And that working code we're going to see it is going to see it in GitHub.
So it's pretty easy, right?
So GitHub basically serves us same as Google Drive, but for coding.
All right.
So let's begin with a slide.
And for that, I need to turn off the camera and let's begin.
All right.
So basically, GitHub is work, same as Google Drive just for code.
Once having our code on GitHub cloud, it is safe from being corrupted or deleted on our local machine.
Then as a ninja developer, our main mission is to keep the existing working code safe.
GitHub allows us to use git commands, which you're going to see in the following next year to keep
our code controlled and managed.
In this section, we're going to learn the following thing.
We're going to create a new GitHub account, then create a new repository on GitHub.
Basically, a repository is like a folder on the cloud of GitHub.
OK, so the repository is a folder of our project on the cloud.
So we're going to create a new repository on GitHub and upload our existing project.
So first of all, go over to gate half.com and open a new account.
I'm going to open incognito because I've already opened an account.
And once you go here, just click on sign up and go through a normal registration process.
Once you do verify your account by clicking on the link that you get from GitHub to your email, then
once you are signed in and verified your account, OK, once you're sending, you're going to see this
screen and you can see here that I'm already signed in and everything's OK.
Then please download GitHub Dotcom and install it, it's a desktop program.
All right, once it's installed, we're going to do the process of connecting between GitHub account
and GitHub desktop program.
OK, so let me just open GitHub desktop.
There it is.
And from here, I'm going to sign into my account.
So I have automation ninja user.
OK, by the way, I clicked file options and then I had the signing button automation ninja user and
the password is all right.
It worked.
So no one's going to file an options.
I can see my account signed in right here.
All right.
Now what I'm going to do is I've already created a repository.
So just wait just one second, OK?
Once you're signed in.
Yeah.
This is the screen.
Once you're signed in, you will see the following screen, this screen.
Now, what I'm going to do is, is to click on this button right here at an existing repository from
your hard drive.
Basically, I'm going to take the project that we have been working on since the beginning of the course
and point out to GitHub, the file, the folder that I would like to upload to the cloud.
So clicking on this last button right here and pointing out to the parent folder of our project.
All right.
Where is it?
Yeah, here is so I'm basically selecting this Python training folder, which is the parent folder of
our project that we've been working on since the beginning of the course select.
And so and once I selected it, I have here a small hyperlink, which is WeChat, which says create
a repository.
OK, so I'm just going to click on it and then I create a new repository.
Screen would open.
I have here the name of the project, the description.
And here I have the local bath, which points out to the folder of the project, click the check box
of initialise readme file and click create a repository.
What happened now is that we have created a repository right here, we can see the current repository,
python training, and this repository currently is on our local machine, on our PC or Mac.
It was yet to be published in GitHub Cloud.
We're also currently on our main branch.
OK, this topic, remember it branches will be discussed in the following lecture.
But for now, just remember that we are in on our main branch right here.
The third button to the right, we're seeing the button publishers repository.
Basically, once we're clicking on this button, the project that's on our local machine will be published
in GitHub Cloud.
So let's click on it.
All right, publisher repository.
And you can see right here, this is being published right now, fetching a region.
Hang on.
All right, so now basically our project in the local folder, OK, where we have created our project.
Let me just bring it from my other screen.
Just a second.
Oh, yeah, here it is.
Yeah, so this project right here is in sync with the guitar becloud.
OK, so we basically took this folder with all of these classes, all of these modules that we have
created and we have selected whatever we have here with our GitHub cloud.
All right.
And also now I'm going to show you how these three.
All right, we have GitHub and we have by charm and we have our local folder.
All these three are connected.
All right.
So I'm going to show you this by the following way.
OK, so pay attention.
This is by charm, and this is my project.
All right, right here, I'm going to add the following line.
I'm going to add print, then ABC.
All right.
I have added this print action command action to the project, which was not here earlier.
And I'm going to open GitHub desktop.
And you can see here that I have removed the print X, X, X, and I have added the print ABC to our
project.
So whatever line I have removed, I have removed this line.
And this is the line that I've added to the project are all mentioned here inside GitHub desktop.
And if I go to a different file, OK, let's go to oh maybe here now and here I can put print.
Best going back to your desktop, so you can see here as well the changes that I've made in the project,
both of these are mentioned here as single records.
And in here you can see green, the lines that I've added.
And in here you can see in green here and in red, you can see the lines that have been removed.
OK, so GitHub sees these changes.
And let's for let's say, for example, that this change I don't want to push GitHub cloud.
Right.
Click on it, discard, discardable, abort the changes immediately.
And you can see here.
All right.
You see here at the right, the test command.
And once I'm going to push.
Right, click on it and discard.
OK, this command disappeared, OK?
It disappeared because I told Kitab, please ignore this change and as I just just said, pie, charm
and guitar, dotcom cloud and our local folder are all connected.
So once I click here, discard it, basically told Kitab, ignore this line.
So also pie chart removed that line and now we're going to made some changes.
All right, print.
You know what?
Let's just make some small changes so we won't mess up our existing files.
Just I removed your space.
All right.
Also, you can see here the changes of removing the space and you can see here the record, and I'm
going to leave a small note here, OK, small changes made, space was removed.
All right.
And now we're going to do two simple steps.
We're going to click.
This commits to me, OK?
Comet made the change sort of go into hold.
OK, it was yet to be pushed to the cloud.
It's now on hold, but it was not yet to be pushed.
And now we have this button right here, push origin.
And you can see no one here.
And you can see one indicator that we made only one change here and we're going to push this change
into the cloud.
OK, so clicking Bush, we have pushed the change into the cloud.
OK.
So that's about it.
We have pushed the change into the cloud and now they are all synched together and also we're going
to have a look on what we have, what we are having on the cloud right now.
Let's try to find argued Fab.com account.
There it is.
OK, so one's going to our account.
This is the main page.
Yeah, this is the main page of the account.
You can see how that commenter mentioned in your user going to repositories.
This is our folder.
I want to become a ninja developer and this is our project.
OK, so in here you can see all the changes that were made.
Basically, the changes here indicate what time they were made.
Basically, all these changes are the push that we have made.
And in here we can see space removed.
OK, small change made, space was removed.
This is what we just wrote in GitHub desktop.
All right.
And here is all of our code.
OK, so the reasoning that we have is GitHub is to, for example, let's say that we have created lots
of lots of files here.
We've created a whole program that runs sync synched together and everything was fine.
And then we have some team members that made some changes and left the code like this.
And we have an error here.
OK, and this error appears only on this local machine of this developer.
And we want to keep our project safe.
So basically, there is going to be a person that will check the code of that developer and after only
after he will check it.
This guard person does this like senior developer.
After checking the code of its co-worker only, he will upload the code to GitHub.
So you're going to have some gatekeeper over your code before uploading it to the branch.
And this is how you keep your project safe from errors, because if you are going to upload a code with
an error like this into your cloud, then you are done.
You are on a very bad shape.
So GitHub is basically like a mid stage between the local code that I'm writing here in my computer.
Then you're going to have a person that will check the code before uploading it to the GitHub account.
And the GitHub account always must be a stable working version without any errors.
So this is the safe zone.
The hab cloud is the safe zone, and this is the tool that we're going to use to control our code between
our local machine and our cloud.
All right.
I will continue this topic in the following lecture.
Thank you and bye bye.