I has asked today what github is, after bringing it up in discussion concerning files that have come out of CultureCode hack this weekend. I suspect this will not be the last time I’m asked, so thought it an ideal subject to post about. So here is a brief discussion for absolute beginners, hopefully with all the jargon taken out:
git is a system for storing files. Those files are stored in a database on your local machine, and that gives it some special properties: the files can be versioned. That means changes to the files can be recorded by the database, and so you have a complete history of all the changes that have been made.
The database you have on your machine is called a git repository. Even though you manage your local files in your local database, its reach is much further than that. You can synchronise the changes in your git repository with a remote git repository. Other people can share that repository, so you can see the changes that each of you makes.
When git repositories are synchronized (e.g. when you push all the changes in your repository to the central repository) git will ensure that all the changes are merged together nicely, but will also ensure that any changes can be picked apart and undone if necessary.
It can get pretty complicated if you look at it too deeply, but usually works smoothly. Essentially it allows many people, all distributed over a wide geographic area, to work on one central set of files, i.e. one project – usually a software project. However, it allows those different people to manage their changes locally, without affecting anyone else, and them the changes can be merged together at a time of everyone’s choosing.
So, different can be working on different parts of a large project, each perhaps making many changes, but pull all those parts together in one place as each part is, in turn, completed.
The central repository is where github comes in. github is one of the first, and the most famous of the git repositories available on the Internet. As well as the basic git functionality that you would use on your own machine, it has many additional features and tools that make collaboration with large teams of developers very easy.
github provides free public repositories for open source projects. So long as the code being managed in the repository is available on an open source licence, and is free for anyone to look at and download any time they like, then the repository is free. Private repositories are also available with a subscription cost.
Here, for example, is the initial data put up by Alistair for the CultureCode hack:
Anyone can download that data and use it. You can then make changes to it, and request that those changes be pushed back to Alistair’s repository (but that would be a decision that Alistair would made, since he is the owner of that repository).
It needs to be mentioned that git is a distributed change management or code control system. Everyone working on a project will take a copy of the whole of the central repository, and when working on that repository that they have copied, they are essentially working independently. They do not have to push their changes back to the central repository, and even if they do, the repository owner does not have to accept those changes (assuming the pusher has not already been given permission to push anything they like already).
This gives both support to sub-projects to develop code without falling over each other’s feet, and also the ability for a solid product (e.g. a software application) to be put together without accepting changes that may break it.
- git allows lots of people to work on a software project from different locations, at the same time.
- github provides public repositories where the software projects can be hosted and shared.
- A git repository is a lot cleverer than simply a shared network folder, because it tracks changes and supports the merging of changes in very clever ways.