In this video we're going to talk about how to contribute to open source and actually take you through
the steps.
But first for those of you who don't know what is open source, well, a lot of technology that have created
the Internet that we know it today has been built on top of open source projects and open source projects
means that anybody can view the code.
Anybody can see the code of a program, can inspect it, can modify it, can enhance it. In this way, the idea
is that by sharing this information with everybody we get everybody's input and we use the collective
mind to improve software. Not only that it's also benefits everybody.
For example, the most famous open source project, Linux is an operating system just like Windows or MacOS
except it's built by everyday people.
It's code, it's completely open source.
Anybody can inspect it and add on to it. And it's become so successful that most of the cloud that we
know with most servers usually run Linux.
So not only do you get to work with other developers from around the world you can build great projects
by just working in teams and learning how open source works and you don't have to create something as
big as an operating system.
Finally, a lot of employers look upon open source contribution as a plus. If you're able to put in your
resume that you're an open source contributor,
well, that's a good sign.
Plus it teaches you valuable skills using git and github to working teams.
So let's show you how to make your first Open-Source contribution.
Let's go to the zero to mastery organization here on github.
This was created as a practice ground for you, a playground.
Nobody will yell at you if you break things. You can contribute, add silly things whatever you want.
It's a testing ground.
So you have as much fun as possible.
And we have a great community of administrators that will help you with these open source projects.
By the way who are these administrators?
Just want to give a shout out to them. They are fellow students that have been kind enough to dedicate their
time maintaining some of our open source projects so you can say hi to them.
They're very very active on slack as well.
But any time you make a pull request or contribute to open source you're most likely going to be communicating
with at least one of them.
So hello to all of you.
All right.
Let's look at how to make your very first Open-Source contribution.
And by the way it's not limited to just this. Once you contribute here you can go off and contribute
to other open source projects all over github.
There are so many to pick from.
You can just pick whichever one you want.
Or you can stick to these ones and make them better and better.
We definitely have a great community of developers and we can create some awesome projects together.
Now the way you want to get started.
Well luckily for you there's actually a start-here-guidelines.
So if I click on this, you have a step by step instruction on what to do.
The first thing you want to do is actually read about the anatomy of an open source project but also
check out that get started guide by our wonderful fellow student that contributed her time and she's
actually an admin as well.
And created this beautiful guide for you to follow step by step instructions on how to contribute.
So after this video definitely check out this document.
But I'm going to skip over this and get to the part where we start contributing.
All right.
So the first thing we want to do is we want to find out which projects you can join by clicking on this
Google sheet over here.
We see all the projects that we have.
And at the bottom tab these are the projects that you can sign up for.
So in my case let's say I want to contribute to the travel guide.
I'm going to enter my github username here.
In my case, it'll be, this handle and that's it.
And the admins are going to look at that and add you to the project.
Alright.
So once we've selected that-once we've selected which project we want to join, and by the way these projects
you can also visit in the 'Zero To Mastery' Web site.
You can see over here that the 'travel-guide' has all this information,
but when we click on it well there's not much happening here so you want to start the ball rolling so
others can contribute and contribute, and eventually have a finished application.
Alright, so
that's the first step.
Let's look at the second step that we have and we want to sign up for the project you'd like to
contribute to and you can sign up with the Google form, again created by our administrators.
And in my case I want to sign up for the travel guide.
And again my github name is this and I should provide my Slack user name as well.
I'll submit, there you go.
We've submitted this so that the administrators are notified.
And then finally if we go back
we go back to the 'start here guidelines'.
Step three is done.
Step four is to make our very first pull request and I'm not going to bore you. I've given you resources here.
But this video, I'm going to
show you exactly how to do your very first pull request.
And what we're going to do is in the 'start here guidelines', we have a contributors file and this contributors file
has all the people that have submitted pull requests and want to be part of this organization.
You see that our list is getting pretty pretty big.
So the way we do this, first thing we want to do is we want to click on this 'Fork' and 'Fork' means you
want to copy this project so it shows up in your github profile.
So I'm going to fork.
It's -it'll ask you where you should fork, you want to fork it to your own personal place.
It's going to copy the project and forking from 'zero to mastery start here guidelines'.
all the way into yours.
So you see that now it's your
username / start here guidelines
with the little fork sign over here.
Once you have that you click on clone and we want to clone and download this entire repo.
So again I'm going to copy, go to my terminal and in my desktop, I'll just do 'git clone', again we should
know how to do this by now.
I'm going to clone the project so that this will be on my desktop.
All right.
Perfect.
And now we can 'cd' into this project which is 'start here guidelines' and perfect.
We have our folder with all our files.
If I open sublime here I will have my 'start here guidelines' repo
now on my computer.
So in the 'start here guidelines' the number four step asks us to update the contributor's file to include
your name so everybody should do this that goes to this course is at the bottom to add your name to
the list of contributors.
Now as we know, we don't want to work on master,
We want our branch out.
So we're going to 'git checkout'
And this is the short way of creating a new branch,
So we're going to checkout and create a new branch calling git -let's call it 'test' for now.
All right.
So we've created the 'test' branch, we're in the 'test' branch and in here we can create our changes.
In our case, in the contributor's file at the very bottom
we want to add our own github username as a contributor.
In our case this is using markdown and in markdown.
This is the syntax for it.
We want to show the square brackets where we're going to display and then the normal brackets afterwards
is the link.
So this is going to be a clickable link with a link to my github profile.
All right.
So if I save this and go to '*git status'
oops, 'git status' - if I can spell
We see that the contributors file has been updated.
I can -I'll just 'git add' and 'git commit' and I'll just say that this is a 'test'
perfect.
So one file has changed and now all we can do is 'git push origin' and we want to push it to
our 'test' branch.
So 'origin' means that we want to push to our forked repo.
So that is right here,
out forked repo,
that is the 'origin'. And in here, I'm going to push to our 'test' branch.
So that is the branch. We press Enter, perfect.
Looks like our changes have been pushed. Let's clear this,
so it's a little bit cleaner, and go back to the website and look at that.
We see that 'test' is now up there and we can create a pull request.
However there's one issue here right.
If you look over here I just made a push to my forked version, but if I go to the actual 'start here guidelines'.
So let's go to the 'start here guidelines' here.
Look at that, I have myself who has just created a minute ago from a forked version a pull request.
So if I click on 'compare and pull request', look down over here I see that I just added my name.
I can now say "Just added myself to the list. Please let me in".
And you can actually tag one of the admins here if you want.
In my case I'm going to tag myself because I am an admin.
Or -actually I'm not going to tag anybody since I'm here anyway-and I'm going to click 'Create pull request'
And look at that, we now have a 'test' branch and this 'test' branch is now ready to merge into master
with my name here.
So just to make sure that this works before I click merge I'll go into the 'zero to mastery',
'start here guidelines' and look at the contributor's file.
You see that my name's not at the bottom.
But as soon as I hit 'Merge pull request' and this is something that only if you're an administrator.
In my case I can do it so I can merge it myself, an administrator will merge it for you.
They will click 'merge', 'confirm merge' and there you go.
We are merged into master and I can delete the branch because we don't need it anymore.
So this's good practice now.
If I go now back to this and refresh, look at that, my name appears in the contributor's file in the
'start here guidelines' on the 'zero to mastery'. Very cool.
OK, so now that we know this, let's actually show you how to contribute to one of the open source projects.
I'm going to back to 'zero to mastery'.
And if you remember I signed up for the 'travel guide'
and then the 'travel guide' over here,
well, it has nothing.
So I'm going to contribute an index.html file.
I'm going to clone the repo - ooh, first I have to fork, remember? I'm going to fork.
Perfect, I have it on my own branch.
Now I can clone this repo onto my laptop, so I'm going to move out of the 'start here guidelines'.
I'm going to 'git clone' the 'travel guide'
Perfect.
Let's go into the 'travel guide' now.
And I'm on the master branch but I want to create a new branch.
I'm going to say 'git checkout' and I'm going to say 'indexfile' branch. And within here I can now open sublime.
And let's just add a simple index.html file. I'm going to say 'new file', 'index.html'
And within here using my short key command, I'm going to say title will be 'travel guide' and I'll just enter a
simple header one tag that says 'trabel guide', with an exclamation mark because we're really excited to
work on it.
And I can't spell not 'trabel'
It's 'travel' guide.
All right.
Perfect.
I'd save that.
Go back to github.
If I go to 'git status' I can even do 'git diff' and this will show you the differences. In our case there's
no diffs because we've just created the file. And I can just do 'git add', 'git commit'
"adding index.html'
And then finally 'git push origin'
And then we can do 'indexfile'
All right, if I click enter.
All right.
I've just created a new branch and sent it up to github.
Let's see if I go back to github.
I see that, yeah I have a new pull request which is great.
Now what if I go back to the 'zero to mastery/travel guide'
All right,
I have it here as well. In my case, I'm not going to worry too much about my pull request,
You can do this on your own. But for the 'zero to mastery organization', I'm going to say
'compare & pull request'
I see that I've added the index file.
I would notify somebody on the team like "hey, just adding index.html"
"let me know what you think?". I'm going to 'create pull request'
And by the way how nice is this? github says "Hey, be sure to review the code of conduct because we have
a code of conduct file for open source" which I recommend that you read.
But otherwise, let's create the pull request.
And again I'm cheating here because I am an administrator on this.
So I shouldn't merged my own pull request but in our case.
I know that I did this right.
I'm just trying to 'merge', 'confirm merge', 'delete branch' and check it out.
Our 'travel guide', now has an index.html file.
How cool is that.
I just contributed to open source.
So there are other projects in 'zero to mastery' that you can do this with.
that don't have an index.html, so you can actually go ahead and do that now and start off the
project.
And as more and more people come on they can add on to this, add a CSS file, a javascript file and eventually
have a nice beautiful travel guide. The one last thing I'm going to show you something quick that you can do
Well, I want this to be used on github pages.
I can just go to 'settings', scroll all the way down to github pages, select master branch as my
github page, click save and if you scroll all the way down now, check it out.
We have a link for our 'travel guide'
So now again you can do this with all the new projects. You can edit the description and add a website.
If I click save, check it out, 'travel guide' now has a website that we can use.
So as people join into the project they can see what the latest master is.
So as we add on to the project, newcomers can see how our travel guide is going. By the way you want to know
something else that's cool
by following these steps. Well, remember how we've created in the 'start here guidelines'? How we've added the
contributors?
Well if your name appears in the contributors, the admin will give you access as a contributor.
And when you get that, well, in your profile, you'll have a cool little icon 'zero to mastery organization' icons
and you can have many of these and people that work at companies have logo of their company
as well.
But this way you get to have a cool little 'zero to mastery' icon created by one of our students. But that's
it.
That's open source. And I highly, highly recommend that you get involved.
It's a great way to work with others.
It's a great way to learn how git and github really work.
But most importantly, we don't care if you break things.
This is a fun little playground for you to practice so that when you are at a real company you know
exactly what to do to make pull requests, to make merges and to create features.
There's no doubt that there's a lot that an individual programmer can do.
However, the progress in scale that something can be built is really compounded when many people work
on something together.
I can't recommend this enough for you.
Go make your first Open-Source contribution and have fun building things with your fellow programmers.
It may one day lead to you impressing a potential employer.
See you in the next one, Bye-bye