This is another video from chapter 18 of our course, and now we are going to learn how to manage our repositories. Hello, how are you doing? Welcome to another video here in your HTML with CSS course.
We are in a somewhat intermediate chapter, right? We've started the intermediate part of HTML and CSS, and in chapter 18, we're looking at how to manage our repositories, both local and remote. In the previous video, we created our first repository, but I'm going to teach you how to manage them, how to create new ones, how to create an empty one to start working with, and how to delete an existing repository.
We'll see all of that from now on, alright? So, sit back comfortably, follow the steps, pause the video if you need to, perform the process in your repository, and then come back to watch. There's no point in rushing and trying to watch everything all at once.
Errors will start to happen. Calm down, calm down, calm down. The screen is coming up, but I have an important message for you from Estudonauta.
Are you taking this course because your college is asking you to study HTML, or are you taking the subject and having trouble with it? Probably another subject that causes a lot of trouble, if you're going through this, you know, is C language. Well, know that at Estudonauta we already have ongoing courses for C language and C#language.
The classic C language and modern Microsoft C#using Visual Studio, all complete. So, don't waste time! Go to studonauta.
com right now, enroll, or access it via the QR code appearing on your screen, sign up, and for a monthly fee, get access to all courses and all modules available so far at Estudo. Thank you very much, Estudonauta, for the continued sponsorship, and let's get back to your lesson. Now you are going back to practicing, okay?
So, look, I'm here again with everything closed. Look how cool, look. I will click here on GitHub Desktop, which we pinned in the previous lesson.
Right when it opens, it performs an update to see if you need to adjust anything, because sometimes you might have two computers working on the same project. As I said in the first video of this series, you might be working with a team, or perhaps you turned off your computer, but someone on the team made changes to the repository; you will also receive those people's work. So, GitHub allows for this teamwork.
First of all, to manage repositories, you always have the active repository right up here. In our case, we only have one. So if you click here, there's only one, right?
If I click on this top part here . But we'll create others right now, in just a little bit. True.
How do you work with your repository? How do you go about keeping your repository updated? First place, you click here, choose the HTML repository first.
If you click here, on Open in Visual Studio Code, it will open the folder in Visual Studio Code, right? So, it just opened the folder here, and it’s already open, see, right on the side, you already have access to everything, HTML, CSS. The challenges are 10 challenges, the exercises, you see?
So, now you start centralizing your development, it makes your work much easier, okay? So, we already have 22 exercises basically, right? Because I have two folders here.
But anyway, everything is already organized here. One thing I’m going to do is the following. For example, I’ll edit the README, the README.
md. It's there, HTML 5 and CSS3 course from Curso em Vídeo. Then I’ll add, I'm learning to create websites and now I’m going to manage my repositories, right?
When you do this, notice that from now on you have the following, an icon that we hadn't seen before, that we hadn't noticed before, which is this one. This one says there is a change in my repository , because now Visual Studio Code is compatible with repositories, so it's telling me there's a change to be made here. There's even another indication here, an 'M'.
This 'M' means the README. md has been modified, okay? If we go back here to GitHub Desktop, it will already notice.
Look at this, look how cool. Let me minimize my Visual Studio Code here. Look at what it asked .
It noticed. There is a change in the README. Before I had, look at what it does.
It shows here. Before I had this, and now I've added this, look. I added a blank line and added a paragraph.
Look at that. When you do this, it updates my local repository, okay? For my local repository to be updated, I have to make a commit down here, look.
I'm going to have to see a commit here. You put the title you want for the commit, which I'll put here, look, updated the readme. Right?
When you put updated readme and click commit to master, look, when I click here, look, I clicked, it already made the update. My local repository already has the version, right? It will say that it has already added that line.
That's it, it's already updated on my computer. Now I need to update it on my GitHub repository, which if you look here, look, let's open our GitHub here, look. Github.
com/professorguanabara, which is my repository, right? So, look, I've already accessed Gustavo, professor Guanabara and here I have my HTML CSS repository. If I open the README, look, it's not, the README doesn't have that line I added because I haven't updated my remote repository yet.
How do I do that? I'll go back here to GitHub and I have this option here, look, push origin. Remember that origin is everything that is remote, it's our remote repository.
So I have here, look , something to update in my repository. When I click here on push, it's going to make me wait. Look, it's updating.
OK. Nice, it's already updated. From now on, if I come here and click on Readme, look there, I'm learning to create sites and now I'm going to manage my repositories, see?
So, to make changes to your project, you change whatever file you want. You're going to change whatever file you want. For example, challenges.
I'll come here to the challenge, to challenge 10, which is that challenge of mine, right, that I created in the previous class. I'll open the file, let's say, androidsite. txt.
I'll put site here on the first line. Just that. I added a line there.
It will already mark here as modified. Do you see? In my challenge 10, okay?
A little dot here marking that there is already a modified file. When I come here, look, it's going to say, look, you changed the Android site, you come here, look, I changed the text, committed on my machine, push, it's already going to the repository, right? So, the procedure is always this.
If by any chance, remember, Visual Studio Code closes or you close it by mistake, just click here, look, open, choose the repository and command it to open with Visual Studio Code. And it will already open the entire folder. And then it gets easier for you to manage.
All right? Including, look, it opened with the files we were editing. I'll close here and I'll create a new repository.
For me to create a new repository, you might say, "Oh, but I had a little button that I clicked, where is that button? " It's not there anymore. But you can come here, look, up here in the menu, click on file, new repository or press Ctrl + N.
When you press Ctrl + N , that exact same window will appear. Now I'm going to create the JavaScript repository. So, let's go.
I have it here inside documents, studies, JavaScript in lowercase. Remember the tip I gave you, look? Right-click, properties.
I'll take the name of this folder, copy it, come here, paste. The description: JavaScript course from Curso em Vídeo. Here, look, in local path, I'll put the same folder as here, look, where the JavaScript one is.
I click out here, okay? here is this path , I copy it, come down here, select everything and paste. Let's initialize with Readme.
Let's not put anything in the ignore. And the license is MIT license. I created the local repository on my own JavaScript machine.
I have some little files that I put inside there. So it's there. It has already created the local repository on my machine.
Inside JavaScript, there are already three files there, see? It already has the files and there will be the dot git folder. If we look here at show hidden items, the dot git folder is there, right?
I'll uncheck it, otherwise it keeps showing a bunch of stuff I don't need. Now I'll go to publish because I don't have, look, I still don't have the repository. If you come here, look, to professor Guanabara , in the repository, I only have one repository, okay?
I'll refresh here. There's only one repository. There's only one repository.
If I come here to GitHub Desktop and click publish, see, it will choose JavaScript, JavaScript course for me. Uncheck this option so we can keep it hosted and publish. It is pushing everything up there.
In this case, it will be much faster for it to send. Always wait for the whole process , okay? The procedure must finish.
See, it is compressing the files here and will send them up there. It is already here. It is going.
Wait a second. And it's done. If I go back here to my repository and refresh, see, there is only HTML, CSS.
I will refresh now. I will have two, see, two repositories, the HTML one and the JavaScript one, right? If you want to create a repository that doesn't exist, let's assume the following: oh, I have here within my studies, a document studies HTML, CSS, that I created before learning Git, GitHub.
Now I want to start learning PHP, for example. So, I want a PHP folder. Here I don't need to create this PHP folder.
I will simply say the following, look. I'll go to file, new repository. Then I will create a PHP folder, okay?
In this case , there is no folder, but there is PHP. Description, PHP course from Curso em Vídeo. I will put it in the same studies folder we had already made.
Initialize with Readme and MIT license. Create repository. I will create the local repository.
Look there, it already created the PHP folder for me. See? It already created it.
If I click on publish, I will choose here. Let's assume, I will make a mistake here, look. I will keep it private.
I didn't forget to uncheck it. I was too fast, I clicked publish. Man, this is the big mistake of those who are starting, trying to do everything in a rush.
You try to do it in a rush, you will make a mistake. You will deviate at some point and it will go wrong. Oh, it published, it already sent it, it was super fast, right?
And if I go back here to my repository, now I will have three, look . I will refresh, look. Now I have three.
You will say: "Hey, Guanabara, only two appeared". It is because, actually, it only shows the first two. If you click here on repositories, you will see the three, see?
And look here, look. Notice. Notice is great.
I have PHP, it is private. Nobody will be able to access it, only me when I am logged in. JavaScript is public, HTML and CSS are also public.
Let me show you something else, since this lesson is about managing repositories. Now, if you go back up here, you will see which repository is currently open. You can work with several repositories, but only one can be open at a time.
I know, I know that everyone with a YouTube channel is always bugging you to subscribe to the channel, to like the video, to send comments, well, know that this is very important and I will be one more of those people. Man, if you believe in the "Curso em Vídeo" project and these classes are helping you a lot, help us by leaving a like, sharing on your social media, and leaving an encouraging comment on this video. This helps us a lot with a factor called engagement that YouTube has.
And the more engagement we have, the greater the reach of the video, and the more it is offered to the community . So, please, help us out, it costs nothing, it takes no time at all, and you also help us a ton. I can come here , open the HTML one, now I'm working in the HTML repository.
JavaScript, now I'm working in JavaScript. PHP, now I'm working in PHP. The proof will be the following.
For example, I'll select HTML here. I'll click open with Visual Studio Code. When I click on open with Visual Studio Code, it will open my HTML folder.
See? Everything is there, the challenges, the HTML exercises. I'll close it, I'll change the repository here to JavaScript and click the same button.
It will open Visual Studio Code directly in the folder, here in the JavaScript folder. Everything is just right. If I close it , change here to PHP, I've switched to PHP.
Opening in Visual Studio Code. See , it already went to the PHP folder. Another very important thing, there are people who get tangled up here.
Ah, but I want to delete the PHP repository. I created it wrong, right? I set it as private.
I want to delete it. First of all, you don't need to delete it to make it public, okay? I'll show you right now how to do it.
So, I'll go to my repository, I'll open the PHP repository, which is the one I want, the one I messed up on, right? Actually , when you open the PHP repository, you will click here, on this "settings," the last option up here. Clicked on settings, here is the repository name, and everything else.
If you scroll to the bottom, so, opened settings, scroll to the bottom. Here you have, look, change the repository to public. Just click on make public.
Then it will ask, look, to make it public, you have to type, look, professor guanabara/ phpirmar. So I just come here, look, professor Guanabara/ph understand. Clicked it, and it will become public.
If I come here to my repositories, look , if I click here on professor Guanabara, click on repositories, remember that PHP was private, right? Look there, it's not anymore. If by any chance, oh, I created it wrong, I messed up and now I slipped, I want to delete the PHP repository.
You can delete the PHP repository too, but you have to delete the local repository and the remote repository. How do you delete the local repository? Some people think, oh no, I'll delete the local repository, I'll delete this folder here.
You'll cause a huge problem. How do you delete a local repository? When you have folders with projects with repositories, the correct way to delete is here, look.
You will change the repository. Look, how do you change the repository? Let me zoom in here.
You will click on the current repository and switch to the repository you want to delete. PHP, which is what I want to delete. You will come here, look, to repository and click on remove .
When you click on remove, it will say the following: "Look, do you want to delete the PHP repository? " You will say: "Yes, I do, I want to delete it". Actually, you are not deleting the remote repository, you are deleting the local repository.
So, let's go. I want to remove it, in fact, I want to send it to the trash, I want to delete the folder and send it to the trash. Then you check this option here.
If you don't check it, it keeps the folder there. You click here, it deletes and sends to the trash. I will click on remove.
And look, it doesn't have the PHP folder anymore. Look, my repositories, I have HTML, CSS, and JavaScript. Let's see what happened to the folder.
Look, there's no more PHP folder, there's only the HTML and JavaScript folder. But you might say: " Man, I deleted everything". Look, it's here in the trash, see.
If I come here to the trash, the PHP folder is there. I'm even going to empty the recycle bin . Right-click on the recycle bin, empty it.
Alright. Did I lose my PHP project? Not yet.
Why? Because you also have the remote repository. Look here.
If you refresh here, it kept the PHP repository. But how do I delete a repository from here? Guanabara.
You click on the repository, click here on settings again. It's right here close to my head, look. Let me move over a little bit.
I'll click on settings. Then you scroll all the way to the end, right near where it says to make it private or public, called Danger Zone, which is the dangerous area. Be careful because you can't undo this.
And you can come here, look, the last option, delete this repository. I'll click here on delete. It will say: "Look, to delete it, you have to type this thing here.
You always have to type something to delete. I'll put here professor guanabara/php, exactly as it is asking here. I understand.
Clicked. And now, look here, your PHP repository has been deleted. Now, my dear, if you access your repositories up here, look, you will see that you only have two repositories, which are the JavaScript CSS and HTML CSS repositories.
And you deleted the PHP repository and there's no going back because you deleted the remote one and you deleted the local one, okay? First we delete the local one, then we delete the remote one, okay? Be very careful with this, because many students delete the local one and think they deleted the remote repository, but it doesn't delete, okay ?
You have to go there manually and delete your repository. Got it? We learned how to add new files, commit new files, commit new changes to our files, in our current repository.
We learned how to create new repositories without using that initial GitHub Desktop screen. We learned how to modify some properties of the repositories we created and how to delete a local repository and how to delete a remote repository. So now we know the basics of managing repositories and we already know how to make commits.
A commit creates versions of your code. In the next video we will continue our studies of Git and GitHub, enabling the website hosting feature. A big hug and see you next time.
Bye.