Put simply, GitHub is a “hub” where people can collaborate on a variety of documents. Although GitHub works with everything from Word documents to Excel spreadsheets, it’s most popularly used by developers who want to collaborate on code. GitHub allows developers access to Git, a version control system (VCS) that’s specially tailored for programming projects. We’ve taken some time to explain Git and how GitHub has revolutionized collaborative programming.
Also see our article How to Show GitHub commits in a Slack Channel
What is Git?
Remember collaborating on high school group reports in the days before Google Docs? You’d email the report around, making sure everyone got their contribution done. Sometimes you’d make edits to your contribution and email around an updated copy. Before long, there were about three to five copies floating around, each containing some but not all of the final edits. Finally, one of you would cave and take on the heady task of reducing all of the versions to a single up-to-date document.
Eventually, Google Docs would make collaborating on documents about a thousand times easier, allowing you all to work within a single system on the same document and tracking updates. Googledocs, like Git, is a version control system. It is designed to track and merge updates, making it easier to work collaboratively on a single project.
Git is a VCS created by Linus Trovalds, the creator of Linux, so you already know it’s going to be developer friendly. In fact, it’s developer friendly at the expense of other file types. Instead of allowing real-time updates, like Googledocs or GitHub’s predecessors in the programming industry, it requires people to download a full version of the project and edit it locally. They then upload their update. As a result, there are numerous “updated” documents tracked in the system.
This should sound daunting if you’re looking to collaborate on PowerPoint or Word. But it’s ideal for programmers. After all, too many cooks editing code in the same document could significantly damage the integrity of the code. What’s more, changes in one place could affect how another part is coded. If individual developers aren’t aware of what their colleagues are doing, this could spell confusion and potential disaster for the code.
Instead, each developer gets to work with a “blank canvas” of the existing main version of the project. They upload changed versions to the “staging environment.” From there changes can be “committed” to the final product. After changes have been committed, they are part of the main code that will be downloaded for future changes. In this way, Git makes it easier to view, accept, reject, and revert changes, protecting delicate code from disaster.
GitHub is a “hub” for working with the Git VCS format. It comes with a variety of features to make developers’ lives easier.
- Repository – Commonly called the “repo,” this is where all of the updated versions (and the primary version) of a project are stored. This is your staging ground for the project. Each repo has a unique URL for easy access.
- Forking – Unless developers pay for a private repository, their project can be viewed by all other members of the GitHub community. If these members feel they could make a worthy contribution, then they can create a new project (repository) from yours. This is called “forking a repo.”
- Pull Request – After forking a repo and making new changes to existing code, GitHub users can invite the developers of the original repository to view the changes.
- Merging – If you like the changes someone made after forking your repository, you can opt to accept those changes and merge them with your existing repository.
- Changelogs – This lets developers working on a single project see all changes, who made them, and when.
- Networking – GitHub makes it easier for budding developers to get seen. Every user as a profile showing projects they’ve worked on and any forking they’ve done. When you submit a pull request, the developers you submitted to can view your profile. This tells them a little about your expertise and may inform whether or not they merge the changes.
The Future of Programming
Forking is widely considered GitHub’s flagship feature. By making it easier for programmers to get noticed, they are leveling the playing field. What’s more, the social and collaborative nature of the platform makes it easier for smaller projects to get noticed and get made.