How to upload a project / folder to GitHub

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's see how to upload a project or a folder to github.com so i have this folder in my case it's just a website that i downloaded completely from the internet but it can be any project that you want in any programming language and it can even be completely unrelated to programming just a bunch of files that you want to store in github.com so what we're going to do first is open the web browser and head over to github.com and you're going to need a github.com account so either sign up if you don't have an account yet or sign in if you already have an account great and now that we're logged in we're going to create a new repository which we're going to do from here a new repository and we need to give a name to this repository so i'll call it website1 to be consistent with the name of the folder on my desktop the one i wanted to upload to github.com so this is the name of the folder and i'm going to use the very same name but you can use any name you want for the repository and you can make this new repository either public so anyone can access it or private and then only you or people you grant access to can access i'm going to go with public for this demonstration but you can go with either one notice that i'm not going to add the readme file because i already have some files that i want to upload these are the files in there folder on my desktop so i'm not going to add the readme file and let's just create the repository great and we got some instructions and we'll soon get back to them but first we're going to install git so git can be installed from git scm.com and here you can download git for windows so let's do that and i'll go with a 64-bit version and the installer is being downloaded and it was downloaded let's start the gate installation we first need to accept the license terms and we can choose the git installation folder unless you have a good reason to change it i recommend to go with the default so that's what i'm going to do i'll just go with the default and now we're going to get a long list of questions and i'm just going to next my way through them so change nothing and just hit next over and over again great and git is being installed and git was installed let's close the installer and now let's get back to the instructions we got on github.com on our new repository so here on the left i have the folder that contains the project that i want to upload so i'm going to right click here and choose show more options and then git bash here and git bash is a command line tool for git that's a bit similar to the linux terminal so let's start going through the instructions so what the first one does is create a file that only contains the name of the repository and nothing else the purpose of this command is to make sure that we have something in our folder and it's not completely empty since i have many other files i don't need this line and i don't want this readme.md file so i'm going to skip the first one but if your folder is completely empty you probably want to copy this line and then run it in the git bash let's now move on to the second one this one and what this one does is initialize our folder as a git repository now if we take a look at the folder itself it seems that nothing changed but actually something did change and to see it we're going to ask windows to show hidden files and folders and as you can see we now have this dot git folder it's a hidden folder so we don't see it by default and this folder is essential for git to work correctly and this is what sets the folder as a git repository so we now have this folder and we know that our folder was set as a git repository so let's hide it and let's move on to the next command which is this one and the idea here is that we need to use the add command for all of the files that we want to upload now gate works in two stages stage and commit so in order to commit any file we have to first mark it as staged using the add command now in the example here they only add the readme.md file and that's because they assume you only have this readme.md file in your repository but since in our case we have a long list of files we're not going to add them one by one what we are going to do is use git add and then dot which means adding all of the files within the folder so i'll just type git add and then dot and the dot means all of the files and folders within this folder so let's add them and if we now run the git status command we can see that all of the files are green and they are under this category changes to be committed which means that they are all staged so we staged all of them let's move on and the next command is the git commit command and this is the command that's actually going to create the commit which can be later uploaded to github.com so let's copy this command and by the way we can see here the commit message within their quotes so right now the commit message is first commit you can of course change it if you want but i'm going to go with first commit so let's just hit enter and you can see that we got an error because our user is not defined yet within git so let's configure user using these two commands and now that we configured our user we will be able to commit the staged files and the files were committed let's move on to the next command and what this command does is creating a new branch which is called main you can use any name you want for your branch but the convention is to use main the next command is creating the remote repository which is on github.com and notice that this link is based on your username on github.com and the name of your repository so what this comment will do is link the remote repository on github.com to the local repository on the local computer and all that's left is running this command the push command that will upload our commit to the remote repository on github.com we now need to login to github but since we're already logged in here in the browser all you need to do is click here sign in with your browser and then we need to authorize the git credential manager and it's done and as you can see everything is being uploaded now to github.com and the commit was pushed and if we now refresh the view in our repository in the remote repository on github.com we can see all of the files over here on github.com and we can see the contents of any of them so for example index.html and here is the code of this specific file let them say that i want to download this repository back to my computer or to any other computer in the world all i need to do is click here on code and copy this line by clicking here and we copy the link to this specific repository so let's as an example clone this repository to see workspace so first let's create this folder on the c drive and here i'm going to open the git bash again so right click show more options and git bash here and we simply need to run the command git clone and then paste the link we just copied and we get an exit copy of our repository over here
Info
Channel: Abstract programmer
Views: 68,996
Rating: undefined out of 5
Keywords:
Id: p8bZBvcFPuk
Channel Id: undefined
Length: 9min 14sec (554 seconds)
Published: Mon Sep 26 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.