What is GitHub and Why Should You Use it?21st September 2017
GitHub is a name synonymous with code and software development. In this article, I’ll explain what it is and why you should use it. Before we can explain what GitHub is though, we have to first know what Git is.
What is Git
Git is a distributed version control system, which is a fancy way of saying it’s a piece of software which helps you and your team write code.
Back in the dark old days when you’d written some code, you’d fire up your favourite FTP program and copy your code onto your server. What was wrong with that? Well, if you and a colleague had worked on the same file at the same time, it would be very easy to lose some of your work as your changes would be overwritten when your colleague copied their changes to the server.
How does git solve this? Well with git, everyone has a full copy of the code base. In git, the code base is known as a repository. When you make a change to your code, others on your team are able to merge your changes into their copy of the code.
This allows teams of developers to work on the same code without worrying about saving over each other’s changes. Git makes this merging process simple.
Other Git Features
Git is a distributed VCS. This means that each copy of the repository has the ability to become the master copy. So if one copy of the code becomes corrupt or is lost for what ever reason, another copy is always safe and ready to take its place.
As mentioned earlier, git has fantastic support for teams. It allows for branching and merging changes, prevents teams from overwriting each others code and keeps a full history of all changes to the code.
As a result of the full history being kept, it makes performing a rollback of your code trivial.
To read more about git, check out the git website. https://git-scm.com/
How does GitHub fit into all of this?
Now that we have some idea of what git is, let’s discuss where GitHub fits into it all.
In it’s most simplified form, GitHub is a place to store git repositories. However, in reality, it is much more than this.
Let’s discuss some of these features.
Github allows you to fork repositories. This means you create a whole new repo which has diverged from the original. This is most open source software is updated. Users will fork a repo, make some modifications, then request that their changes are merged back into the original. This is done with a pull request.
A pull request is created when you want to merge your changes into a repo you forked. When a pull request is created, it allows you and the original author to discuss your code. It also allows the original author to request changes.
GitHub allows users, at a glance, to see who changed what file and when. It also shows any commit message that was created with the changes. When working in a large, or distributed team, knowing who worked on what can be vital when tracking down a bug, or getting up to speed on a new project.
GitHub could almost be described as Facebook for developers. There is a huge social aspect to it. Projects are openly discussed and decisions made in GitHub comments. Bugs are often reported and solved by the users of a project before the maintainer ever has to get involved.
GitHub is a place for creative professionals to share and store their work and collaborate with each other. It is used by countless companies and for good reason. Sign up now and start sharing your work.