To be able to collaborate and work on the same code base we need some sort of central point to store our changes, as explained earlier on in this document where we called this the “hub”.
This is probably why the owners of Github gave it this name, because it acts like a hub.
Another reason why we use Github is because it allows us to review each other’s changes.
It also allows us to keep track of the merges that have to be done.
To clone a repository from Github all that you need to do is go to its URL, for example:
Find the “Clone or download” button and click it:
Now you can copy the URL, go to your terminal and execute the following command:
$ git clone git@github.com:kakeyang/jobright.git
This will clone the repository in a new directory which will be named “jobright”.
Github also supports us in the process of merging branches. This is done by creating a so called “Pull Request”.
These pull requests allow us to do some last minute checks before we merge our branch.
Github will notify you when the merge would result in a merge conflict. Some projects might have a CI server working for them that has notified Github that the build has failed/succeeded. And last but certainly not least, someone will need to review the changes you want to merge.
To make a pull request you have to do the following:
After someone has approved your pull request and checked the conditions above, you can merge the pull request.
Do not merge pull requests that have not been approved!