Introduction to Git and GitHub – Part 1
GitHub is a web-based platform for hosting and managing software development projects, built on the Git version control system. Like a cloud drive, it allows you to store and manage files, but goes far beyond that by offering complete version control, easy collaboration between developers, and issue tracking features. To understand how it works without diving into complex details, let me tell you a little story:
Chrome and the “repository mine”
Meet Chrome.
Chrome: Charmingly unstoppable!
Chrome is a cheerful fellow who loves creating files and sharing them with his friends. He used to use all kinds of quirky methods to send them (letters, carrier pigeons—you name it!). It worked, but every time he wanted to make a change, he had to send the updated file to all his friends again. The problem went both ways: when a friend modified a file, they had to send it back, and others wouldn’t see the change right away. Worse still, if multiple friends sent him their modified versions, he’d end up overwhelmed with files!
One day, Chrome came up with a solution: he created a mine.
The repository mine.
This mine allowed everyone to pick up files contributed and modified by the team in a centralized place, avoiding duplicate chaos. Let’s call this mine the repository. To make transferring files easier, Chrome created a local copy of the files from the repository, which he placed in a cart:
The cart is a local copy of the mine's content.
Since Chrome just created the repository, there are no files yet. So naturally, his cart is empty. The next step is to fill it up. For example, Chrome decides to create File A:
Chrome creates File A — I think it’s a great file, don’t you?
Pleased with File A, he wants to share it in the mine so his friends can see it. He does this in several steps:
First, he prepares File A for sending by adding (add) it to his cart:
Chrome adds File A.
So his friends don’t get lost in the mine, he writes a little note about the change and attaches it to the cart. This commitment (commit) officially validates the content of the cart.
Chrome describes the change: "Added File A." (Trust me, English-speaking friends, this is what's written on the drawing)
By attaching the label, he validates the change — ready to go!
Once everything is ready, Chrome simply pushes (push) his cart into the mine to share it. Easy!
PUSH
Here’s come a new challenger!
Now meet Nickel.
Nickel: Distinguished by his aerodynamic bowler hat!
Nickel is a good friend of Chrome and also loves creating files. When he hears that Chrome created a repository, he’s eager to join the project. Chrome trusts him, so he gives Nickel access to contribute.
To get File A, Nickel must also create a local copy of the repository, stored in his cart. Then he pulls (pull) the content of the mine into his cart:
PULL
Nickel decides to improve File A and, feeling generous, also creates a new File B:
Nickel modifies A and creates B — doing the whole alphabet would take too long!
Nickel now follows the same steps as Chrome to share his updates:
He adds the modified A* and the new B files to his cart:
Added files A* and B.
Then he writes a note and attaches it to confirm the changes:
Nickel commits his changes.
Finally, he pushes his cart into the mine:
PUSH
If Chrome or any other collaborator wants to get Nickel’s changes, they just need to pull the updates:
PULL
Thanks to this mine, everyone can get the latest updates, contribute improvements, validate and share them, avoiding the confusion of traditional methods.
THE END
Git and GitHub - Comparing to the Mine
Through this slightly wacky story, we’ve implicitly explored vocabulary and actions related to Git and GitHub. Remember, Git and GitHub are not the same! GitHub is the hosting service, while Git is the underlying technology managing versions.
It’s like GitHub gives you a visual interface to interact with Git commands (Git is the whole mine with the carts, and GitHub helps you see it more clearly). Let’s look at the terms we’ve discovered:
- Repository: The core element of GitHub. It’s the folder containing all the project’s components. As seen with Chrome & Nickel, a repository can have many collaborators and can be public or private.
- Clone: A clone is a local copy of the repository stored on your own computer instead of online. In the story, that’s “creating a cart.” It’s within this local repository that you can work offline.
The other bolded terms you saw throughout the story — add, commit, push, pull — are Git commands used to manage files. To better illustrate them, we’ll explore them in the next part of this tutorial by creating our own repository.
Credits
- Writer: Ousmane THIONGANE
- Lastest update: May 2025
- Reviewer: Loubna LATRECHE, Justine XIANG