Chapter 4: Git Getting Started

Git Getting Started.

You’ve already asked about install, config, Git vs GitHub… now we put everything together into the complete beginner-to-first-working-repo flow — the exact path most people follow when they truly start using Git for the first time in 2026.

No skipping steps. We’ll go slow, explain why each command exists, show real output examples, and build a tiny project together. By the end you’ll have:

  • Git installed & configured
  • Your first local repository
  • Commits, status, log, diff
  • A branch + merge
  • Pushed everything to GitHub

Ready? Let’s begin like day 1 of a real bootcamp.

Phase 1 – Prerequisites Checklist (Do this first!)

  1. Git Installed? Open terminal / Git Bash / PowerShell → run:

    Bash

    → You should see git version 2.53.0 (or very close — that’s the current stable release as of February 2026). If not → go back to our “Git Install” lesson and install it now.

  2. Identity Set? (super important — appears on every commit)

    Bash
  3. Modern defaults (2026 style — saves headaches)

    Bash

    Quick check:

    Bash

    See your name/email + main branch default? Good!

Phase 2 – Create & Understand Your First Repository

Goal: Make a tiny “personal-notes” project.

Bash

Output you’ll see:

text

→ A hidden .git/ folder appeared. That’s your entire version history database — don’t delete it!

Phase 3 – The Sacred Everyday Cycle (Add → Commit → Repeat)

  1. Create your first file

    (Use VS Code, Notepad, whatever — or terminal:)

    Bash
  2. See what’s happening

    Bash

    Typical output:

    text

    → Red = untracked (Git doesn’t care about it yet)

  3. Stage the file (tell Git: “I want to snapshot this”)

    Bash
    Bash
    text

    Staging area = “preparation zone” before taking photo

  4. Take the photo (commit!)

    Bash

    Output:

    text

    → First commit done! 🎉 You now have version history.

  5. See your work history

    Bash
    text

    Or use our alias:

    Bash

    (Even prettier with graph when branches come)

Phase 4 – Make Changes & See Diff

Edit README.md — add one more line:

text

Now:

Bash

You’ll see red/green lines:

diff

Stage & commit again:

Bash
Bash
text

Phase 5 – Time Travel Basics (Undo / Go Back)

Made a typo? Want to see old version?

  • See what changed in last commit:

    Bash
  • Go back temporarily to previous version:

    Bash

    → README goes back to old version (detached HEAD warning — normal)

  • Return to latest:

    Bash
  • Oops — want to undo last commit but keep changes?

    Bash

    → Changes back to staged, commit gone

  • Throw away last commit completely (careful!):

    Bash

Phase 6 – Branches – Your Safety Net

Don’t experiment on main!

Bash

→ Now on new branch.

Add to README:

text
Bash

Switch back:

Bash

→ Change disappeared! (safe)

Like it? Merge:

Bash
Bash

Clean up:

Bash

Phase 7 – Push to GitHub (Make it Live!)

  1. Create repo on github.com:

    • New repository → name: personal-notes-2026
    • Public / Private → no README/init files (we have our own)
  2. Connect & push:

    Bash

    → First time may ask login (browser pops up or use PAT)

Now refresh GitHub → your commits & README are online! 🌐

Your First-Day Workflow Summary (Memorize this)

  1. git status — always first!
  2. Work → change files
  3. git add . or specific files
  4. git commit -m “clear message”
  5. git push (after first setup)
  6. Repeat 10–20 times → muscle memory forms

Bonus commands you’ll use daily:

  • git pull → get latest from GitHub
  • git clone url → copy someone else’s repo
  • git branch → list branches

You did it! You’ve gone from zero to real Git + GitHub working project in one sitting.

Next class?

  • Conflicts & pull requests
  • .gitignore
  • Real team workflow
  • Or fix any error you hit during this?

Just tell me what felt tricky or what you want deeper — we’ll keep building. You’re officially “getting started” now — proud of you! 🚀

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *