Learning git basics
The first thing I wanted to learn was how to do my daily workflow — the stuff I usually relied on VSCode integrations for — directly in the terminal.
Learning Git in the Terminal
The first thing I wanted to learn was how to do my daily workflow — the stuff I usually relied on VSCode integrations for — directly in the terminal.
Nothing fancy.
Just:
- stage changes
- commit them
- push to the repo
That’s it. The absolute basics.
Turns out this wasn’t some arcane ritual. It was a quick search, and everything clicked.
What I Realized About Git
One thing that surprised me:
Git doesn’t actually “handle” your files.
It just keeps track of what changed.
Think of Git as a diary for your project. It doesn’t rewrite anything; it just asks you to explain what you did, so you can look back later and understand it.
Your explanation? The commit message.
The Command That Saves You Every Time
If something looks broken or weird:
git statusThis is like asking your diary:
“Show me what I changed since my last entry.”
It tells you:
- Which files are new, modified, or deleted
- Which changes are ready to be saved
- Which changes aren’t being tracked yet
Example for non-coders:
Imagine you’re writing a report. git status tells you which pages you’ve written, which pages are still drafts, and which pages you haven’t even touched yet.
Stop Writing Garbage Commit Messages
Commit messages are your way of explaining changes. Don’t just write:
- "lul"
- "stuff changed"
- "fix"
Instead, say what exactly changed:
git commit -m "your meaningful message here"Non-coder example:
You’re keeping a cooking journal. Instead of “changed recipe,” write “added garlic and reduced salt.” Later, you’ll thank yourself.
The Basic Commands I Use Daily
Stage changes
git add <file-or-folder>What it does:
Tells Git, “I want to include this file in my next snapshot.”
Example:
git add report.docxMeans: “Include the updated report.docx in my next commit.”
Commit with a message
git commit -m "your meaningful message here"What it does:
Saves a snapshot of the files you staged. Think of it as saying, “This is how my project looks now.”
Example:
git commit -m "Added introduction to report"You’ve now officially recorded that your report got a new introduction.
Push to remote repository
git pushWhat it does:
Uploads your changes to GitHub (or another online storage).
Non-coder example:
Imagine you’ve written your diary locally and now you’re sending a copy to a cloud folder so others can see it or so you can access it anywhere.
Two Other Essentials
Check current status
git statusAlways run this if you feel lost. It’s your project’s “current state” report.
Initialize a new repository
git initWhat it does:
Starts tracking a new project. Git will create a hidden folder to keep all your version history.
Non-coder example:
You bought a new diary. git init is like opening the first blank page and writing the date at the top.
Final Thoughts
From now on I’m ditching the comfy UI buttons and doing the basics straight from the terminal.
It’s:
- faster
- clearer
- more reliable
- and feels like “real work”
Once you understand what Git is actually doing, the fear disappears. It’s not complicated. It’s just picky.
Next step: branching and rebasing.
Hopefully, by then, my diary analogy will still hold up.