Git & GitHub Tutorial for Beginners #12 - Forking (& Contributing)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
our gang and welcome to your 12th get and guitar tutorial and in this video I'm going to show you how you can flock a repo on github in order to contribute to some kind of open source project so then sometimes when a developer makes some kind of new project or framework what they do is open sourcing which basically means they make their source code freely available to all the developers online now to do that they'd probably use a service like github and create a public repository to host their code on so that all the developers can see it and that's really cool because it means that other developers can then contribute to that code work on it in the wrong time develop new features and overall the project is going to move along much quicker than if just one person was developing it so that's really cool so it works a little bit differently than if you were working in a team on a repository and I'm going to show you how that works now so I want you to imagine we find this cool kind of JavaScript framework online called awesome J source I've just made this repo on a different dormant account for now and we'll take a look at this and we know that we can improve it right so what we want to do is download this repo to our computer make some changes and then push these changes to this repo right here but we can't just do that because we don't really have access to this repository it's not being granted to us because if you want this repository and this framework you wouldn't just want to give anyone access to it so they can just upload branches all the time or even update the master branch you don't want to allow them to do that so instead what we need to do is something a little bit different so if we come across some kind of framework there's someone else owns and it's open source what we can do is we can fork that repository and basically what that means is it's going to create a copy of this repository from this account from net ninja ones account to our own account so let's fork that I'm going to click that fork button right there and it says forking nettinger one and this should just take a few seconds and now you can see it successfully thought that so that now on my account right here I have this repository and now what I can do is I can clone this repository to my desktop so what I'm going to do is come to the client or download and I'm going to click this to copy to the clipboard and we've seen how to clone a repository to our local hard drive all we need to do is come to our terminal and we need to navigate to where we want to clone it I'm going to go up one level and I'm going to clone it right here so I say git clone and then paste this URL in so that's going to clone it now to my hard drive and then what I'm going to do is go into that directory so that directory is going to be called awesome Jas sauce so we'll say CD balsam - Jo - sauce and we're going to go into this directory okay cool so now we can say something like git status just to make sure everything is fine yet what on the master branch in Seoul today so now what we can do is we can open this project in Atem over here so I'm just going to click all to get that menu and then go to open or add project folder and then I'm going to go to recording and it's called awesome Jaya sauce so I'm going to open up this repo right here cool so now we have access to the main JavaScript file and also this source stuff in here so what I'm going to do is just come under here and I think what I want to do is console.log your prep website is now awesome so this is my addition to this library which was already really really good nothing so basically all I've done is make that one change now normally what I do is I take out on your branch to make this change and then push the branch up etc but this time what I'm going to do is just stay on the master branch just for simplicity and for the sake of this tutorial so anyway now we've made this change what I want to do is add this change you need to say git add and then I'm just going to do a dot add everything then we'll commit it and we'll leave a message to say improved awesome Jas and then what I'm going to do is push this now to the origin remember when we clone a repo like we cloned the one on our account it automatically sets up that alias origin right so it knows where to push too so origin and we're pushing the master branch so once I push that up I should be able to see it on the github account but let's just give this a second to give us some feedback cool that's all done now let's go to the github account so now if I go into the source folder and I go to awesome j/s I can see that the Eddy I created is now there okay I remember this is all on my accounts this isn't the original repo for the framework I thought this to my account cloned this repository and then uploaded the new addition to my repository on my account and now what I want to do is I want to contribute this change to the original framework the original repository so how the hell do what is that well let's just go back to the main page of this fault repository and we're going to see this button right here new pull request so if we're happy with what we've done and we want to add this functionality we want to contribute this to the main repository what we can do is click this new pull request and that's going to check if this can be merged so it can and what I want to do now is say create pull request right here so it's going to pull it into the master branch of this thing over here nettinger one right because that's what we're pulling into this is the original framework where the repository is located so I can leave a comment here if I wanted to blah blah blah and I can go down and I can create this pull request so once I've created this notice I cannot merge this not from here because I'm not allowed to do that if anyone could just merge into this then anyone could just enter at any time without the original creators knowledge so the original creator is going to have access to who is allowed to merge basically and he has to review or she has to review the changes so I've opened this account in a different browser and if i refresh now and if I take a look at the pull request I can see there's one pull request right there so someone wants to make a contribution so I can click on this and I can view what they want to contribute I can see the file has changed and I can see we've added this console that log thing right here so if I'm happy with this what I can do is I can write a comment if I want I can say yeah good don't know what action that was okay I can merge this into the main branch the master branch so I'm going to confirm this merge they've made this framework ten times better and now if I go to this original repository I'm going to notice that the awesome.js file has now been updated with my contribution I feel so special okay so let me know that's how you basically contribute to some kind of open source project now every different open source project is going to have different guidelines for contributing and normally they're going to have some kind of file in their repository called contributing contribution or contributing dot MD so I'd advise you always to read through those first of all because there will be some kind of guidelines you have to adhere to and if by the way you just want to play around and fork a repository I've created one on my account and you can do that and that is called git playlist so if you want to fork this and just add some different commits you know try and pull requests into it if I like it then I'll merge it at the minute it's just a ninja JavaScript file with a control that log so it's entirely a blank canvas for you to play with so yeah feel free to go ahead and add to this imagine it's some kind of cool new framework and do what you want and yeah have fun
Info
Channel: The Net Ninja
Views: 110,060
Rating: undefined out of 5
Keywords: git, github, git tutorial, git tutorial for beginners, github tutorial, github tutorial for beginners, what is git, what is github, git vs github, how to use git, git tutotirals, github tutorials, tutorial, git fork, forking, fork repository, fork repo, forking a repo, forking a repository, github forking, github fork, github contributing, fork tutorial, forking tutorial, how to fork a repo, how to fork a repository
Id: HbSjyU2vf6Y
Channel Id: undefined
Length: 8min 26sec (506 seconds)
Published: Sun Jun 18 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.