Uploading Files To GitHub Quick Start Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's up everyone so in this video i want to show you how to get some project files up from your computer onto a remote repository on github.com so this is meant just to be a quick start guide on how to get some files from your machine to a remote repository this won't be a full tutorial on github or git uh i will link up a video by brad traversie that really goes in depth on this topic but i just want to create the quick start guide so the biggest reason for this tutorial is the fact that i've seen people using the drag and drop method where they'll create a remote repository and then they'll just drag the files in like that now besides the fact that that's not really a good way to work with git the biggest issue that i saw in this is the fact that not all the files will transfer over in this process and i've seen that issue occur quite a bit so unfortunately i did this in a tutorial myself so i want to just go ahead and correct that and have a video focused on this topic so we are gonna focus on an article that i just wrote up so this will be linked up in the video description so if you want to follow along with this go ahead and check that out so what we're going to do is first create the remote repository on github.com then we will download the get installer we'll download git create the remote repository or the local repository and then we'll just take those files and push them up to this remote repository so go ahead and check this article out i'll move it out of the way here and we will start by going to github.com if you don't have an account go ahead and create one it's free get that set up and then once you have it go ahead and go to your repositories and just go ahead and create a new repo here so go to new here i'm just going to create one called my project so whatever you want to name it i'm not going to add a description you can leave yours public unless you actually want it private i'm going to set mine to private we won't add a readme file we'll just go ahead and create that remote repository so i'm going to leave this open here we're not going to follow these steps just yet we have to do a few things here so i'm going to leave this open in order to start getting our local projects onto github.com we need to download git so go ahead and just do a search for get here just let google find it for you click on that this link right here will be in the description also and i'm going to use windows for this so whatever you have go ahead and download the installer for your machine so we'll give this a few seconds here and we'll just run through this process okay so the installer set up here we'll just go ahead and leave the defaults here so we'll just hit yes and i'm just going to let the default settings be set up i just uninstalled it for this tutorial so i might have to override some things unless you have some custom settings just go ahead and let it kind of guide you through this process okay so that's successfully installed let's go ahead and uncheck that we'll hit finish here we'll close out this link right here and i'm gonna open up the article because now that we have get installed we have access to all of these commands and i just want to run through these individually and then we'll go ahead and get started so we have the first command which is get init this initializes a local repository just like the one we created on github.com so what we created here it creates a local version of that git status this just lets us know what's in our staging area all the files that we're ready to start merging into that local repository git add goes and actually preps those files and then git commit commits them into that local repository now once those pri once those files are committed to that repository we set a remote so we let it know what remote github account to link to and i'll show you how to do that and then we just push those files onto that remote repository so there's get pull and get cloned we won't go into detail with those i'll show you an example but that's not really the scope of this video so i'll go ahead and move that link again let's minimize this and let's go ahead and first let's search up for git bash so we downloaded git and this is git bash and i know a lot of people like to work directly from this i actually like to work from the windows command prompt so let's just start here let's just do git dash dash version and this will tell you the version of github you have so if you successfully downloaded everything you should see this i'm going to close this out and i'm going to open up my windows command prompt so if you already had it open you might want to close it and reopen it to let it update but i'm just going to do get let me zoom in here and we'll just do git dash dash version okay so that means everything's connected successfully and what i want to do is go ahead and initialize a local repository in the folder that i have on my desktop so i have it set up right here it's called my project so i will cd into that so cd into desktop and then i'm gonna cd into my project so it doesn't matter what language you're working on this is actually a django project that i just initialized so now that we are in that project folder i'm gonna run git init so this will actually create a folder in that folder that we have so in that project folder so if we open this up it might seem confusing because you can't actually see it so let me zoom out here we can't see it because by default that git folder is a hidden file now if you want to see that we can go ahead and go to hidden items check that and that's what we just created so let's just run through that one more time i'm going to delete that let's go ahead and open up our terminal and because i deleted it i can initialize it again so if we go ahead and do that there we go they there are our local files so once we initialize it let's go ahead and actually start setting things up so we want to go ahead and run git status i want to see what's going on here and this tells me that i have two files and folders prepped for my staging area now to actually add them what i could do is just do git add and then set the file name or folder name so i can just do like manage dot py let me zoom out a little bit let's see so i can specify a specific file or folder but what i want to do is add all of these so i want to make sure everything in here is added so i can do git add and then dot so i can actually check the status again so i can do git status and there we go so it tells me that these files are now in that staging area and they are ready to be committed now if i happen to make a change so let's actually open up that folder and let's go ahead and go into the settings.py file and let's make a comment so i'm going to make a comment here so this doesn't matter again don't focus on the language if you're not familiar with django i just made a change and if i do git status we should see that a file was modified so when this file is modified we need to go ahead and re-add that so i can just do git add and then we'll just run it status again and now we are all up to date so these files are ready to be added they are in our staging area we added them and what we want to do to actually add them into this git folder is we want to go ahead and run git commit and we want to commit them to that folder so just to get commit dash m and i'm not gonna not going into details of what's actually happening here so that tutorial by brad travis will explain a little bit more but we are going to commit the files we can write whatever we want here we'll just say first commit and i probably misspelled that but it doesn't matter so there we go now it told us that it got these files and it added them into that github folder so what i can do here is actually just run git status again i can check the status and it's going to tell us that there's nothing to commit everything was already committed so what we want to do next here is i can actually go to that remote repository and if you follow these steps it's going to tell you what to do here it's telling you to first initialize it we can create that readme file you don't actually need to do that even though it's good to do that it tells you to commit it we just did that and then it tells you to create a branch so by default the default branch is master this is telling you to change that branch you can do that if you want you can name it cookies if you want it doesn't matter you can name it however you wish but if you want to go ahead and skip this step which we will we will leave the default master branch we want to go ahead and run this command next so this is the url to the repository so we just created it and what we're going to do is run git remote add origin so we're setting the origin of that remote to that github repo so let's go ahead and open up that command prompt again we'll just go ahead and paste that in so git remote add origin and then we set that so we just set that remote and now it knows to take these local files and when we run that push command it knows to push them to this project folder so if i go ahead and refresh this we see that there's nothing in this project so let's go ahead and actually run that push so now we can run git push dash u origin and then we set the branch that we want to push it to so we're going to push it to that master branch because that was a default branch if you renamed it to main or whatever you wanted you would just go ahead and select that name so you would just set main here but ours is master so we're just going to go ahead and run push here and what's going to happen here is you will be prompted if this is your first time probably for your username and password you can go ahead and enter those and that basically just verifies that you can actually push something to that repository and i have this default um i guess this prompt right here to sign in through the browser because i'm already signed in so you might have this too i'm not sure how that's gonna work so it's either gonna prompt you for a username and password or just to sign into your browser so i'm gonna go ahead and select that because i'm logged into github it authenticated me and it should have pushed those files so now it pushed the files and there we go so if i go ahead and refresh this repository now we see all the local project files so if i go ahead and go to vs code we see my project manage.py and if i go to the browser or to github we can see all those project files so now i can send this link to anybody i can work with the team and everything is set up and that's how you push the files to your remote repository so two things i wanted to cover really quick here is how to clone a repo and what was the other one oh that was how to ignore files so for those of you working in django or just for anybody needing to ignore some files let's say you have a virtual environment here or let's say we want to ignore manage.py because there's times where you may not want to push all the files to your remote repository so we can just create a dot get ignore so a git ignore file if i can spell that right once we create that let's say we want to ignore this file so i can just say manage dot py and that will now ignore this file i don't know if i need that forward slash at the end or not i believe i do because we are in that file path so this way next time i run those changes if i go ahead and run get status again it tells me that we added that file so once we run those changes again this file will not be pushed to that remote repository so the main reason i use this is to hide maybe some passwords or just to ignore my virtual environment if i don't want that live now the next command for anybody looking to share a project if you're trying to clone one of my projects some people have issues with trying to find one of my projects let's say they want to work on this django pro shop where we build an ecommerce site go ahead and grab this url we'll close this out let's completely open up a new command line or a command prompt here let's see or a terminal so i'll just go ahead and open that up with cd into my desktop because that's where i want it and then we can run git clone and then paste that url so it's as simple as that to clone a project once you run that there you go all the project files are now locally and that's how you clone it so i hope this tutorial was helpful i just wanted to go over those steps check out the article in the link description if this didn't fully make sense you need more information uh check out the other link for bradshaw versus video on this so thanks for watching i'll see you guys in another video
Info
Channel: Dennis Ivy
Views: 378,333
Rating: undefined out of 5
Keywords: Programming, Software Developer, Dennis Ivy, Dennis Ivanov
Id: qMck70tLDuo
Channel Id: undefined
Length: 12min 36sec (756 seconds)
Published: Tue Jun 01 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.