This post is just to get you started on understanding and using Github in 5 mins.
This post is in no way gonna explain and tell you what and how Git works. I’ll link some sources down below for more information .
What is Github?
Github is a web hosting service for version control using Git. It can be used for anything, But it’s mainly used for code.
Let’s get started now:
We’ll take one of our projects as use cases to start with.
- Open github.com and make an account if you haven’t already.
- Once the account is made go to codezoned’s organisation.
For this tutorial we’ll contribute to ScriptsDump (It’s the same process for every repository)
Open ScriptsDump repo and click on Fork (It’s present on the top right side of the page)
After clicking on fork you’ll be redirected to the same instance of the repository in your account.
This is a fork. A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.
Now that you have forked ScriptsDump you can start playing with it. Now, click on “Clone or download”.
Once you click on clone, An option will pop up asking whether to download a zip or to use Github Desktop, Click on Github Desktop.
Download Github Desktop and let it install.
Login to your Github Desktop and on the top left there’ll be an option called “File”. Click on file and then click on “Clone repository”.
Once you click on clone repository a list of your repositories will pop up (Your forked repositories too).
Now your forked repo (Repository = repo) will be downloaded in the specified directory, Navigate and have a look at it.
Now that you have the repo ready it’s time to make some contributions .
Make any changes and additions you want in the downloaded/cloned repo. In this case, I’ll create a folder called strings and add some dummy code in.
- Go to Github Desktop and view the changes you’ve done. Once you’ve reviewed your changes add a title and a description. After that, Commit the changes.
Now go to your account and check the changes you’ve just pushed. If everything’s done properly, Congratulations on your first commit on github.
Now that you have an updated instance of ScriptsDump (Or any other repository) go to the main repository (In case of ScriptsDump, It’s codezoned/ScriptsDump) and click on Pull requests.
Click on new Pull request and a new page will pop up asking which branch of your forked repository should be merged with what branch of the main one. For this case, Select your (head fork) master branch and codezoned/ScriptsDump (base fork) master branch as well.
- Now the only thing left is for the admins to review that Pull request and if they think that everything is ok, They’ll merge it to the main repo.
That’s it. Congrats on your first PR (PR = Pull request). To understand Git and Github better you can visit these links: