GitHub
From ForcaWiki, the simple encyclopedia
| In one sentence | A website where people store, share, and work together on computer code, while keeping a full history of every change. |
|---|---|
| Category | Software |
| Related | Git, Open Source, Programming |
Picture a giant online clubhouse where people keep their coding projects, show them off to the world, and build things together. That is GitHub. It is a website where programmers store their code, save every version of it, and team up with other people, even strangers on the other side of the planet, to make it better.
What is a repository?
Every project on GitHub lives in its own "repository," which is just a fancy word for a project folder. People shorten it to "repo." A repo holds all the files for one project, along with notes about who changed what and when. You can keep a private repo that only you can see, or a public one that anyone in the world can look at.
Saving your work
When you save a change on GitHub, you do not simply paint over the old version. You make a "commit," which is like a save point in a video game: it takes a snapshot of your project and lets you write a short note about what you changed. Because every commit is kept, GitHub works like a time machine. If you make a mistake, you can flip back through the history and return to any earlier save point.
Working together
GitHub really shines when a group works on one project at the same time. Two clever ideas make that possible:
- A "branch" is like making a photocopy of the project so you can try a new idea without touching the original. If the idea works, you fold it back in. If it flops, you toss the photocopy and nothing is lost.
- A "pull request" is how you show your changes to the rest of the team and politely ask, "can we add this?" Others can read it, leave comments, and then accept it.
This is how huge groups of people who have never met can build enormous projects together without stepping on each other's toes.
Git and GitHub are not the same thing
It is easy to mix these up. Git is the free tool that actually does the change tracking, the time machine part, and it runs right on your own computer. It was created in 2005 by Linus Torvalds, the same person who started Linux. GitHub is a website that stores Git projects online and piles all the sharing and teamwork on top. In short, Git is the engine, and GitHub is the online garage where everyone parks their projects and works on them together.
How to use it
The easiest way to start is right in your web browser, with no special tools:
- Ask a grown up to help you create a free account at
github.com. - Click the "New" button to make a new repository, give it a name, and GitHub creates your project's online folder.
- Add a file, either by uploading one or by creating it right there in the browser and typing it up.
- Save your change by writing a short commit message that says what you did, then confirm. GitHub keeps that snapshot forever.
- Open the history to see every saved version of your project, and view an older one if you ever need to look back.
- To help on someone else's public project, make your own copy with the "Fork" button, change your copy, then send a pull request asking them to add your improvement.
Fun facts
- GitHub started in 2008, and its mascot is the Octocat, a cat with an octopus's arms.
- In 2018, the software company Microsoft bought GitHub for about seven and a half billion dollars.
- More than 100 million people around the world use GitHub, and a huge amount of the free, open code that runs websites, phones, and apps lives there for anyone to read.