HomePortfolioBlogGitHub

GitHub

27 March, 2021 - 3 min read

GitHub

We talked about Git last time and briefly about Github. Github is a provider of hosting for software development using git. With Github you can have a decent basic services free of charge, like hosting your repo and collaborating with your folks. Go ahead to their website, register yourself and get an account. The benefit of GitHub goes beyond just storing your code somewhere on the internet, it comes with the benefit of collaboring people and potential to directly deploy to other services like Netlify.

You can create a remote repo on Github and then clone a copy to your local machine, or you can create a local repo first and push it to your Github so that you can start working anywhere.

GitHub comes with GitHub CLI (command-line tool), GitHub Desktop (GUI, really helpful actually) and GitHub Mobile (haven't tried yet). But let's talk functionalities!

Creating, cloning, and archiving repositories

If you create a new repo from scratch, either you can do it from CLI with

gh repo create

or simply hit the + button on your GitHub and give your repo a name. A repo can either be public (everyone can see it) or private (only you can see it)

If you want to get a copy of an already created repo to yourself, you're gonna make a clone. To clone a repo, you can either "Download ZIP" or do it from CLI with

gh repo clone GitHub_name/repo_name

or using Git commands

git clone URL

The URL can be HTTPS or SSH. While HTTPS is just simply the web URL, SSH is known as Secure Shell Protocol, which you need to set up public SSH keys in your GitHub account.

Pull Request

Working amongst people, you fork the repo, you clone the repo, you create a new branch, you make a change in your local repo, you push to your remote repo on GitHub, you want to create a pull request to mention to others about the changes you made. It is then up for discussion amongst other contributors, who can review your proposed changes, maybe add review comments, contribute to the pull request discussion, and eventually add commits to the pull request. If all is well, then your changes will be merged into the base branch.

I urge you to try out this page, it is called Open Pixel Art. The main idea is to teach you how to contribute to an open source project by contributing a pixel of your name and your favourite color into the mural wall of pixel.

To create a pull request, you have to go to the original repo and click "Pull Request". Here you compare the changes across forks and give a description of your pull request. And that is it.

Here are some links to dig in further: GitHub Documentation GitHub Lab

© 2021, Built with

Gatsby