Github: guide for beginners


If you are at all concerned with version control and/or collaborative projects then you’ve probably heard of this platform. If you haven’t, you should because it is something that could help you a lot.

What is GitHub?

Github is a lot of things. You may have heard about it in the context of being a code sharing and publishing platform or that it is some kind of social network for developers. It is both of those things but at its heart it is an online version control and source code management (SCM) system.

Who is the Git?

Git is an open source SCM developed by Linus Torvalds, inventor of the Linux operating system. Torvalds joked that he always names his products after himself and, as he is known to be a little grumpy at times, hence the name Git. Torvalds was looking for an easy to use SCM that could scale up to handle the Linux kernel. He was also looking for a system that was speedy and could handle non-linear and distributed workflows. He found nothing on the market to suit and hence developed Git.

The hub launches

GitHub is an online hosting service, primarily for software development, which uses the Git SCM system. It was launched in 2008 and has grown rapidly to become the pre-eminent code hosting site, with almost 14 million different projects, or repositories, currently hosted.
The site also features social networking features, like followers, feeds and wikis. Once a user has created a profile on the site, they can use chat functionality for live conversations on managing their project. The platform has taken Git’s command line interface and added a much easier to use graphical interface.
The platform is not only useful for developers. Its powerful version control system can be used to host and manage all manner of assets and projects, from Word documents to websites and slide decks.

Key features

The real power behind the platform is its collaborative ability. Users can collaborate easily on projects, updating their own work or changing that of others and working together on projects while interacting with other contributors. Crucially, members can work simultaneously on a single project, without any danger of their work being erased or overwritten by others. This key ‘forking’ functionality allows users to create their own versions of a project before making changes and then merging these different versions back into an updated original. Shared changes are notified to the project owner via a ‘pull request’ and the owner can then merge the changes into the original if he wishes.
The three features of fork, pull request and merge are what differentiates the system from other systems. Previously, users working on a collaborative open source project would have to download the code, make their changes, list those changes and then submit them to the project owner in the form of a patch.

Some common language

Command line: this is the interface we use to input commands to the system. If you use a Mac, you will know it as Terminal. It is downloaded when you install Git.

Repository: this is simply the storage space used to host your project. It might be called a directory or shortened to ‘repo’. The repository can live on your local computer or on the platform itself. Here you can keep all files and assets associated with your project.

Version Control: this is at the heart of the system. If you use something like Microsoft Word, you will know that it overwrites your file each time you save, unless you use the ‘save as’ command to store multiple versions. Git doesn’t do this. It keeps a snapshot of every save so that you can always roll back to any version.

Commit: another core concept. Each time you use the ‘Commit’ command, you create an image of your repository at that precise point in time. This is then a milestone that you can return to at any time, restoring the project to this version without loss or overwriting at any future point.

Branch: this is how Git manages lots of people working on the same project. Each contributor ‘branches off’ with their own versions, making their changes until they are ready to merge them back into the master project.