How to Use GitHub

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
github it's probably one of the most important tools to learn uh because if you use it incorrectly it can be a bit cringe it could be a little bit bad but i think everyone needs to learn it especially if you're using mac windows and linux because you're really holding yourself back and crippling yourself because i recently saw an ltt video where he completely bastardized git which i'll play that real quick snippet just so you can see what not to do when it comes to github so it turns out that right click save target as gets you an html file in dot sh clothing because i don't know some borderline arbitrary reason probably and in order to get it to be an actual sh file i had to copy it into a text editor kate and then save that as a script and execute it in the terminal so first off you never do a right click save as this would be like saving this target as uh an html of ps1 it'd basically be clicking this and saving this entire webpage that's not the way to save it if you ever needed anything from git the first thing i want to teach you is one don't do this never save anything like in in this method no matter what system you're using you'd want to go to raw and this gives you the raw file and this is a very clean file there's a lot of different ways to pull this down now so you could just do like a control s on your keyboard to save this file this would work in mac windows linux it doesn't matter and this would save just this raw file and you'd want to name it like windows dbload ps1 up here and it would save a very clean file which is very very good important to know however most people don't do this most developers are either using mac or linux some use windows and if you're using windows i would highly recommend downloading what's called github desktop this third party tool is amazing there's other third-party tools that are also very good that you can tie in and do this but it's a good way to just basically come in here let's say we want to grab that windows directory and let's say i want to make changes to it typically i would always pull it into here so i haven't actually pulled it into this system yet we're just going to grab this windows 10 script and just hit clone and what this does is it grabs every file in this this thing so if i ever wanted to edit any of these files i could easily just pull up my browser here go to github and you'll see i now have every single file in that get so i could clone it this way if i just wanted one file i could do the raw file by clicking raw and then just doing a control s to save that file or a third way to download from this these are all good methods i would say is just wget come back into your browser and click that raw get this entire raw url and then we're just coming back into here and pasting that url into this right here and you see it's right there i've actually downloaded it a couple times but we can just remove those but that's three different ways to do it one from command line one from your browser and then one using github desktop all these methods are also very good but a fourth way to download that would also be proper instead of doing a weird save as and maneuver which i've never i've never seen anybody do it that way but again to just save yourself some embarrassment come in here click download zip that also would work and you'd get all the files in this project but again it just depends on your preference all four of these ways are acceptable now let's get into the fun stuff like some people are like why is git so complicated why is it so good and it's just because people don't understand the idea behind it it's meant to be a collaborative tool to where you can collaborate with thousands of people at the same time this script right here i've had thousands of people contribute to it i mean it's amazing how many people have done commits and other things and oh hey titus you're terrible at english you've misspelled this and they'll do like what's called a pull request i actually have six uh pull requests so let me just show you that uh why you'd use git so he's actually i think contributed before to it but usually i go to file check and then go hey this is actually wrong so i was installing vlc player right here it looks like it should actually list this instead of finish installing notepad that looks like a legit typo in my part so in this one i'd be like yes let's merge that so instead of me fixing that typo i just went to my pull request and some other genius out there on the internet some kind gentlemen just went ahead and said hey uh let me fix that for you titus you made a typo you big dummy and i'm like beautiful how awesome is that i literally didn't have to fix something someone someone already fixed my project for me now obviously there's there's a lot of other ones and you got to be careful when accepting these merges but that was a perfect example of a beautiful perl request and why you'd want to do open source uh because a lot of people were like hey your windows 10 script is so good you should make it an executable close source it and sell it for some kind of money well i wouldn't be able to profit from this this is really the beauty of it yes there's monetary gain i'm missing out on but think of how awesome this tool could be when it comes to like three or four years from now and we have thousands and thousands of more people into it it would make this project amazing so that's the power of open source that's power of github or git in general because you can use git on different services like gitlab so that's that's amazing i absolutely love this this is one why you you do something like this uh because a lot of people are like well that's silly you should just make money and you know sometimes life's not about money guys again sometimes you can make a way better product using git so that's just one example of it but let's let's give you some more power i want to give you some more examples of how we could use and make amazing things with this so i'm actually going to get out of my windows 10 script now i'm working on something new on my live streams if you ever pop in check them out on tuesday i usually pop in in the afternoon central time and then on friday i usually do it in the morning at nine o'clock so be sure and check them out come in say hi to me i'd appreciate it but right now i'm working on a custom version of debian and debian is basically what almost every single linux distribution is based on it's like the granddaddy of them all so i was trying to make something more of a server based thing with just some really nice gui elements on top of it it's actually this entire system i'm in right now but anytime i make any changes to it i'm always in here and instead of doing these commits i might actually come into this and let's uh let's just get out of this product i'm going to just change it to debian and i'm going to go to this project where i've downloaded and now i've changed in this directory i have a nice little terminal here you don't have to work in terminal you could just work in here or alternatively like some people i know are not comfortable with terminal uh we could easily go into a vs code so let's uh pull up vs codium and i'll take that over here we'll close that and what i'm going to do is just open up that folder and hit ok so what this does is it pulls in this entire project right into vs code uh i personally like to work kind of between code i'm weird i'm i do terminal and i also like gui editors i like to just kind of see what's fastest and i kind of like to go back and forth to see which one could be better so with that i could easily make my changes here let me let me find something here i might want to add i do need to expand i don't want people using alex appearance expand this and let's say i want to save this out over here you'll notice the change we can actually see what's changed so now we get a need to get into actually submitting changes to a project now the change happens let's say you make a change and now you want to you're the only let's say you're the sole owner of a project like this one nobody else is really contributing because i'm still kind of building the foundation uh let's say i want to just i can leave it as blank or usually i like to title it uh let's say doc update i'm just updating documentation and you might just go updating documentation uh and need to expand so that kind of just gives a little bit of a description and of course i'm terrible with english so i always misspell something and then we do a commit we've committed it but if we look back on here into this uh it's not actually there so if we actually look at the readme or actually the user file you'll see our change hasn't done we've done the commit but now we've got to do the push so you might want to as you work on a project a lot of times i might do multiple commits and then do a push because then i i don't want everyone to see those commits before i test them so i might commit the test and go okay i'm going to check back on that in a second but let's say i went through i'm like yes this change is perfect everyone needs to see this you'd push it and now it's pushed and published over here and we'll just do a reload and you should see it everybody in the world can do this so when working in multi systems and also working in collaborative environments this can be very good but usually after you do a commit you usually want to do a push at least sometime soon mainly because if you have a collaborators and you want them to see your commit so they can pull down those changes but if you guys are both working on the same copy and you both are changing things what happens is before you do your commit you'll do a fetch uh which is i'm going to teach you next back in here we would do a fetch and let's say someone else made a contribution or maybe they saw my contribution like expand this uh you need to be what the hell titus let's let's just go what is is this and we'll just do a commit right here so this actually commits and pushes the change directly on it using the web interface now usually this would be another person but for this example i wanted to kind of show what happens when we do a fetch it doesn't show immediately but the fetch will say hey there's polls to happen so now we can actually review those pull changes before pulling them down or we can just go ahead and pull right now we're going to pull and you'll see boom it popped in here and you can actually see i have a little plugin that says hey someone updated this 16 minutes ago and it was labeled update 3 or something like that you can i've you can do really cool plugins with vs code or you can just use terminal 2. it doesn't matter everyone has their own flavor their own development mojo so to speak but this is basic gets and so this is basically how git works you'd want to use it for uh the commit and push when you want to push changes or let's say you just have a project and you just it got updated by your favorite creator and you're like man uh i want to i want to just update mine well then you would just do a poll you would just do a fetch and then it would say hey there's updates and then you pull those updates again and then you have everything up to date that's amazing without having to go to the website at all so very powerful in all these ways this just kind of scratches the surface i wanted to give you just a base layer a base understanding of git because it's such a powerful tool so badly misunderstood and uh when i saw that one linus video and how he he used it i was um i was really upset i was like man this it does not make git look good and it really is possibly one of the best inventions in the past 10 years for the development realm and uh maybe maybe it's been around longer i know i'm i'm pretty new to get so to speak if you look at my commits i've really only powered up in the last couple years and uh that's really uh something it took me a little bit to get but hopefully now you can get a new appreciation forget and how awesome it is and now you can go teach other people and you can use git and maybe you'll contribute to one of my projects i'd love to see a pull request because when you go and push one of my projects what happens is i don't obviously allow you to commit directly to my project but it'll pop into my poll request and then i can say hey what other geniuses out there or aspiring developers are wanting to develop or collaborate with me on projects
Info
Channel: Chris Titus Tech
Views: 46,829
Rating: undefined out of 5
Keywords: chris titus tech, how to use github, how to use github desktop, how to use github with visual studio code, how to use github copilot, how to use github code in my project, how to use github pages, how to use github code, how to use github repository, how to use github in vscode, how to use github projects, how to use github copilot in vscode, how to use github with unity, how to use github desktop with visual studio code, how to use github for web development
Id: v_1iqtOnUMg
Channel Id: undefined
Length: 13min 4sec (784 seconds)
Published: Sat Dec 04 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.