Git VS GitHub: The Beginning of Version Control
Have you felt that familiar anxiety after staring at a terminal full of Git commands, or scrolling through a GitHub repository jammed with branches, pull requests, and merge conflicts? It’s a common hurdle.
Many of us have been there, unsure whether our last commit was a step forward or if we had just created a bigger mess.
But here’s the thing, once you understand the basics & the difference between Git and GitHub, everything starts to make sense.
Git and GitHub are terms you will often hear linked, but they actually serve different purposes.
Why You Need Git in the First Place
Working solo on a project? You might survive with basic file saving (for now). But the moment you add even one more developer into the mix, everything starts to get messy.
If you and your teammate are working on the same file and you complete your changes and send the file to your project head. Meanwhile, your teammate downloads the same file, makes different changes (maybe even deletes your additions by mistake), and sends that version instead. Now:
This is exactly what Git fixes.
Git
Git is a Distributed Version Control System (DVCS) created by Linus Torvalds (yes, the Linux guy) back in 2005. It’s like having a rewind button and a collaborative notebook for your entire codebase.
What Makes Git So Powerful?
With Git, you’re not just writing code, you’re writing a history of decisions. You can see what worked, what failed, who made changes, and how the project evolved. It’s not just about saving code, it’s about saving context.
What Are Git States?
When you’re using Git, your project files aren’t just sitting there; they move through a few key stages.
Working Directory → Staging Area → Repository
(Modified) (Staged) (Committed)
| | |
[git add] ────────────────→| |
[git commit] ──────────→|
Git Basics
Git helps you track your project like a timeline. These key commands are your daily tools for saving, switching, sharing, and organizing code. Let’s break them down in a no-jargon, quick-read format.
git commit – Save Your Work
git checkout – Switch or Restore
git clone – Copy a Repository
git pull – Get Latest Changes
git tag – Mark a Version
GitHub
Now let’s bring in GitHub. While Git lives on your local machine, GitHub lives in the cloud. It’s a platform built on top of Git that makes sharing, collaborating, and managing code easier, especially when working in teams.
What GitHub Brings?
What Is a Git Repository?
A Git repository (or just “repo”) is where your entire project lives — all your files, folders, branches, commits, and history.
Checklist for Hands-On:
In upcoming blogs, we will learn more commands and do some hands-on for better understanding. Before starting, ensure you have:
So… Git or GitHub?
The answer is: Both.