Getting started with GitHub

In this post I will be explaining the use of the GitHub community. GitHub, in short, is a online culture where people are able to collaborate with each other in the coding world. This community is very large with people all over the world using the platform. Many developers use this platform to update their code without overwriting any important lines. Lets face it, we all have the guilt of saving files and giving them a date, but what we can get lost when we have so many of the same file. And not only that, the code will differ (add, modified, deleted) from file to file; so some files may have the code the developers need but others may not.

GitHub has the power to manipulate code from multiple files that can be contributed from other users at the same time into one master version. So in turn, this platform makes a great place collaborate with others in the coding world. For example, if one user decides to add code to a specific file, the others who are also collaborating will be notified about the changes and will have to either accept their input or decide if it isn’t ready. If the code still needs debugging then the code isn’t deleted- it will be put on another branch of the master file.

Below is a screenshot of the user interface of GitHub on their website:

github

1. This area allows the developers to view the master files of their project. Clicking on this button enables the developers to switch to other branches within the master file. These branches do not effect the master file unless the pull request (3) has been accepted by all of the developers within the project.

2. Here we can see how many contributors there are to the repository.

3. The Pull Request allows developers to take the master file and modify it in any way, shape or form. From here, they can then upload there version through a pull request. Anything that has been changed within their version will show in green or red. Green is where code has been added, Red shows where code has been modified or deleted.

4. Here we can see the files that exist within the repository. 

  • NEXT STEP: Editing code.

github2

In the screenshot above I have used the directory (1) to gain access to a file, in this case index.php. Using the Computer icon on label (2) I am able to edit the code using a GitHub GUI client on my Mac in an application form. Although this is possible, the code can still be edited in the browser simply by clicking on the pencil icon, located next to the computer icon. 

githubapp

After clicking on the computer icon “Open this file in GitHub for Mac”, the application GitHub open on my desktop and opens Brackets (code editor). From here I can modify/add code and save it. From there I can then use the GitHub app to “Commit & Sync”. This will update the code on the GitHub network so others in the repository can view it.

 

Advertisements