👋
Welcome — A Friendly Introduction

You are in the right place. This guide will make Git feel simple, practical, and approachable.

Hello, Learner! 🙏

If you've heard words like Git, GitHub, commit, branch, merge and felt confused — that's completely normal. Almost every developer feels that way at the beginning.

Here's the good news: Git is not as scary as it looks. Once you understand what it does and why it exists, the commands start making sense naturally.

This guide is written like a patient teacher. No heavy jargon. No rushing. Just clear, friendly explanations with real-life examples.

✅ What This Guide Covers

  • What Git and GitHub actually are
  • Why Git is used in real projects
  • All important terms with simple analogies
  • Step-by-step workflows for common tasks
  • Most important commands with examples
  • Common beginner mistakes to avoid
  • 7-day learning plan for real confidence

👥 Who Is This For?

  • New developers starting with source control
  • Power Platform makers and app builders
  • SharePoint and D365 developers
  • Solution architects understanding team Git
  • Anyone who hears "push the PR" and wants to know what it means
💡

Reassurance: Senior developers with 10+ years of experience also forget Git commands and Google them. That's perfectly normal. The key is understanding the concept, not memorizing every flag.

📁
What is Git?

A simple explanation of the tool that tracks every change you make to your code

Git in One Simple Sentence

Git is a tool that remembers every change you ever make to your files — like a time machine for your code.

When you write code, you're constantly making changes — adding features, fixing bugs, removing old lines. Git keeps a complete history of all those changes so you can go back to any point in time.

🏫 A Real-Life Analogy: The School Notebook

Imagine you're writing a big school project in a notebook.

  • Every time you make a major edit, you take a photocopy of the notebook
  • You write the date and a note on the copy: "Added introduction chapter — 12 May"
  • Later, if your teacher says the old version was better, you can pull out that old photocopy
  • You can also share copies with classmates who make their own edits

Git does exactly this — but for code files, automatically, and much smarter.

📌

This is called Version Control. It means tracking versions (snapshots) of your files over time.

🔄 When Something Breaks

You add new code and suddenly the application crashes. With Git, say: "Take me back to yesterday's version" — in one command. No manual undo-ing needed.

👥 Team Collaboration

Two people work on the same project simultaneously without overwriting each other. Git handles the merging intelligently.

🧪 Safe Experimentation

Create a separate branch. Experiment freely. If it goes wrong, delete the branch. Your main code is untouched.

📜 History & Audit Trail

See exactly who changed what and when — invaluable for debugging: "Who changed this line and why?"

🌐
What is GitHub?

The online home for Git repositories — where teams collaborate, review, and share code

GitHub in One Simple Sentence

GitHub is a website where you can store your Git repository online — so your team can access it, collaborate, and review code together.

⛅ Analogy: Google Drive for Code

  • You write a document on your laptop → that's your local file
  • You save it to Google Drive → now it's online, accessible, and shareable

With code: write it with Git tracking locally → upload to GitHub → team can access, review, and contribute.

💾 Backup

If your laptop breaks, code is safe on GitHub. Just clone it again from anywhere.

🤝 Collaboration

Multiple team members push changes; others pull them. All coordinated through GitHub.

👁️ Code Review

Before code merges, teammates review it via Pull Requests — like a teacher checking homework before submission.

🚀 Deployment

GitHub Actions auto-deploys your app when you push code — like this very portfolio website!

Local Machine vs GitHub

Your Local MachineGitHub (Online)
Code lives on your computerCode lives on GitHub's servers
Only you can see it by defaultYou control access (public/private)
Works without internetRequires internet to sync
Risky if computer breaksSafe cloud backup
No collaboration featuresCentral point for team PRs, issues, actions
📌

GitHub is not the only platform. There's also GitLab, Bitbucket, and Azure DevOps Repos. They all work with Git. GitHub is the most popular one.

⚖️
Git vs GitHub

They sound similar but are very different things. Here's the definitive comparison.

The Simple Analogy

  • Microsoft Word = the tool you use to write and edit a document (on your computer)
  • Google Docs = the online platform where you store, share, and collaborate

Similarly: Git = tool on your computer  |  GitHub = online platform for storing and collaborating on Git repos.

💡

You can use Git without GitHub (work locally). But you can't use GitHub properly without Git — because GitHub hosts Git repositories.

Side-by-Side Comparison

GitGitHub
A tool (software)A platform (website/service)
Installed on your computerRuns in the cloud
Created by Linus Torvalds (2005)Founded 2008, acquired by Microsoft 2018
Works completely offlineRequires internet
Tracks changes locallyHosts repos for team access
Free and open sourceFree for public repos; paid features for teams
Interact via terminal commandsInteract via web browser or GitHub Desktop
💡
Why We Use Git in Real Projects

9 practical reasons that make Git essential for every developer and team

1. Track Code Changes

Every change is recorded with timestamp and description. Always know what changed, who changed it, and when.

2. Safe Rollback

Spent all day on changes that broke everything? Go back to yesterday's version in one command.

3. Team Collaboration

5 developers, each on their own branch, merging back. Git combines everyone's work intelligently.

4. Safe Experimentation

Create a branch for risky work. Experiment freely. If it fails, delete the branch. Main code is untouched.

5. Code Review via PRs

Before code goes to main, team reviews it via Pull Requests. Catches bugs, maintains quality.

6. Release Management

main for stable production, develop for ongoing work, release/v2.0 for preparing releases. Very organized.

7. Debugging with History

A bug appeared that wasn't there last week? Use git log and git diff to pinpoint exactly which commit introduced it.

8. Parallel Development

5 developers working on 5 features simultaneously using separate branches — no waiting, no interference.

9. Traceability & Audit

Finance, healthcare, and government software need proof of what changed and when. Git provides a complete, tamper-evident trail.

📚
Basic Important Terms

Every Git term explained in plain language with real-life analogies — your Git dictionary

repository (repo)

A folder that Git is tracking. Contains all project files plus hidden Git history.

🏠 Like a house with a built-in security system recording everything that changes inside it.
commit

A saved snapshot of your changes, permanently stored in Git history with a message.

📷 Like taking a dated photograph of your notebook — "Saved with corrections — March 5".
branch

A parallel version of your code where you can work without affecting the main code.

🌿 Like a tree branch growing separately from the trunk — grow it, trim it, then reconnect it.
merge

Combining changes from one branch into another. Git tries to do this automatically.

🤝 Like combining two drafts of an essay into one final version.
clone

Downloading a complete copy of a repository from GitHub — including all history.

📥 Like downloading a full Google Drive folder with all revision history to your laptop.
push

Uploading your local commits to GitHub (the remote server).

📤 Like syncing your offline work back to Google Drive so others can see your changes.
pull

Downloading the latest changes from GitHub to your local machine.

📥 Like refreshing Google Docs to see what teammates edited while you were away.
fetch

Downloads updates from remote without merging. Just checks what's new.

👀 Like glancing at a menu before ordering — you look, but don't take anything yet.
origin

The default nickname for your remote repository on GitHub, set automatically when you clone.

🏠 Like your "home address" — it's where your remote code lives.
checkout / switch

Moving to a different branch. git switch branch-name is the modern way.

🚪 Like going from one room to another — each room (branch) has different things in it.
pull request (PR)

A proposal on GitHub to merge your branch into another. Others review before approving.

📝 Like submitting a report for your manager to review before it goes to the client.
merge conflict

When two people changed the same line of code differently and Git can't decide which to keep.

⚡ Like two people editing the same sentence simultaneously — someone must pick the final version.
staging area

A preparation area where you select files before committing. Not all changes must go in one commit.

📦 Like packing a box — add specific items (stage them), then seal it (commit). Don't have to pack everything at once.
working directory

Your actual folder with project files where you make changes. What you see in your file explorer.

🖊️ Like the open notebook page where you're currently writing.
remote

A version of your repository that lives online. You push to it and pull from it.

☁️ The cloud backup of your project that the whole team can access.
main / master

The primary branch — the stable, production-ready version. Modern repos use main.

🌳 The main trunk of the tree. All feature branches eventually merge back here.
README

A file (README.md) explaining what the project is, how to install it, and how to use it.

📋 Like the instruction manual that comes with a product.
.gitignore

A file that tells Git which files or folders to not track (passwords, log files, build outputs).

🚫 Like a "Do Not Touch" list for Git — whatever you write inside it, Git ignores completely.
🔄
How Git Works — Step by Step

The complete flow from creating a project to sharing it with your team

The Three Stages of Git

StageWhat It MeansAnalogy
Working DirectoryFiles you are actively editingYour open notebook where you write
Staging AreaFiles selected to commit (prepared)Items placed in a box, ready to seal
Repository (History)Committed snapshots stored permanentlySealed & dated box in the archive
Working Directory → git add → Staging Area → git commit → Local Repo → git push → GitHub

Full Git Workflow — Start to Team Push

  1. Create a project folder
    Start with a regular folder: my-project/
  2. Initialize Git
    cd my-project
    git init
  3. Create / edit files, then check status
    git status
  4. Stage the files
    git add .           # stage everything
    git add index.html  # or a specific file
  5. Commit the snapshot
    git commit -m "Add initial homepage structure"
  6. Connect to GitHub
    git remote add origin https://github.com/your-username/my-project.git
  7. Push to GitHub
    git push -u origin main
  8. Create a feature branch
    git switch -c feature/add-contact-form
  9. Make changes, commit on branch, push
    git add .
    git commit -m "Add contact form with validation"
    git push origin feature/add-contact-form
  10. Create a Pull Request on GitHub
    GitHub → your repo → "Compare & pull request". Team reviews. Once approved, merge!
⚙️
First-Time Setup

Install Git and configure it — do this once before your very first commit

Step 1 — Install Git

  • Windows: Download from git-scm.com and run the installer
  • Mac: Open Terminal → type git --version → macOS prompts to install if missing
  • Linux (Ubuntu): sudo apt install git

Step 2 — Verify Installation

git --version
# git version 2.43.0   ← means it's installed ✓

Step 3 — Configure Your Identity

Every commit is stamped with this information — your digital signature.

git config --global user.name "Your Full Name"
git config --global user.email "youremail@example.com"
💡

Why --global? This setting applies to all Git projects on your computer. You only need to do this once.

Step 4 — Verify & Set Default Branch

git config --list                             # see all settings
git config --global init.defaultBranch main  # use 'main' as default

Step 5 — Set Up SSH Key (Recommended)

SSH keys let you push/pull without entering your password every time.

# Generate SSH key (press Enter for defaults)
ssh-keygen -t ed25519 -C "youremail@example.com"

# Copy the public key
cat ~/.ssh/id_ed25519.pub

Then: GitHub → Settings → SSH keys → Add new key → Paste the key.

📋
Git Commands Cheat Sheet

Every essential command — click to expand for full details, when to use, and real examples

📌

Click any command to expand its full explanation. In daily work, you'll use 8–10 of these regularly. The rest you look up as needed.

git --versionCheck if Git is installed▼

What it does: Prints the installed Git version.

git --version
# Output: git version 2.43.0
git configConfigure your Git identity and preferences▼

What it does: Sets your name, email, and other Git preferences. Run once during setup.

git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --list  # see all settings
git initInitialize a new Git repository in a folder▼

What it does: Turns a normal folder into a Git-tracked repository. Creates a hidden .git folder.

mkdir my-project
cd my-project
git init
# Initialized empty Git repository in .../my-project/.git/
git cloneDownload an existing repository from GitHub▼

What it does: Downloads a full copy of a remote repository — all files and complete history.

git clone https://github.com/username/project-name.git
# Creates a folder called "project-name" in your current directory
git statusSee what's changed in your working directory▼

What it does: Shows which files are modified, staged, or untracked. Your constant health check.

git status
# On branch main
# Changes not staged for commit:
#   modified:   index.html
# Untracked files:
#   style.css
git addStage files for commit▼

What it does: Moves files from the working directory into the staging area. Run before git commit.

git add index.html          # add a specific file
git add .                   # add ALL changed files
git add assets/css/         # add an entire folder
git commitSave a snapshot of staged changes with a message▼

What it does: Creates a permanent snapshot in Git history. Commit frequently — every logical unit of work.

git commit -m "Add navigation menu to header"

# Good: "Fix login bug when email has uppercase letters"
# Bad:  "changes" or "fixed stuff"
git logView the commit history▼
git log
git log --oneline          # compact one-line view
git log --oneline --graph  # with branch visualization
git diffSee exactly what changed line by line▼
git diff                    # changes in working directory
git diff --staged           # changes that are staged
git diff main feature/nav   # diff between two branches
git branchCreate, list, or delete branches▼
git branch                  # list all local branches
git branch -a               # list local + remote branches
git branch feature/login    # create a new branch
git branch -d feature/login # delete a branch (safe)
git switchSwitch to a different branch (modern command)▼
git switch main              # go to main branch
git switch feature/login     # go to existing branch
git switch -c feature/signup # create AND switch to new branch
git checkoutSwitch branches or restore files (classic command)▼

Older multi-purpose command — still widely used and valid.

git checkout main            # switch branch
git checkout -b feature/nav  # create and switch
git checkout -- index.html   # restore file from last commit
💡

Use git switch for branches and git restore for files — cleaner and less confusing.

git mergeMerge one branch into the current branch▼
git switch main
git merge feature/login    # merge feature into main
git pullDownload & merge latest changes from remote▼

When to use: Every morning before you start work. Always pull before pushing.

git pull                   # pull from default remote/branch
git pull origin main       # explicitly pull main from origin
git pushUpload your local commits to GitHub▼
git push                        # push current branch
git push origin main            # push main to origin
git push origin feature/login   # push a feature branch
git push -u origin main         # push AND set upstream (first time)
git fetchCheck for remote changes without merging▼
git fetch origin
git log origin/main --oneline  # see what's new remotely
git remoteManage remote repository connections▼
git remote -v                  # see all remote connections
git remote add origin https://github.com/user/repo.git
git remote remove origin       # remove a remote
git stashTemporarily save work-in-progress without committing▼

Use when an urgent bug comes in while you're mid-feature. Stash, fix the bug, then pop your stash back.

git stash                  # stash all current changes
git stash pop              # restore the most recent stash
git stash list             # see all stashes
git resetUndo commits or unstage files▼
⚠️

git reset --hard permanently deletes changes. Not recommended for beginners on shared branches.

git reset HEAD index.html  # unstage a file (keep changes)
git reset --soft HEAD~1    # undo last commit, keep staged
git reset --mixed HEAD~1   # undo last commit, keep files
git revertSafely undo a commit by creating a new "undo" commit▼

Creates a new commit that undoes changes from a previous commit. History is preserved. Beginner-safe on shared branches.

git log --oneline
# abc123 Add broken feature

git revert abc123   # creates a new "undo" commit
🎬
Ready-to-Use Real Scenarios

Complete command sequences for the 6 most common real-world Git situations

🚀 Scenario A: Starting a Brand New Project Beginner

You want to start a new project and track it with Git from the beginning.

# 1. Create the project folder
mkdir my-portfolio && cd my-portfolio

# 2. Initialize Git
git init

# 3. Create first file, stage and commit
echo "# My Portfolio" > README.md
git add .
git commit -m "Initial project setup with README"

# 4. Connect to GitHub (create repo on github.com first)
git remote add origin https://github.com/your-username/my-portfolio.git
git push -u origin main
📥 Scenario B: Downloading an Existing Project Beginner

Your team has an existing project on GitHub and you need to work on it.

git clone https://github.com/team/project-name.git
cd project-name
git branch -a
git switch -c feature/my-changes
✎️ Scenario C: Make a Change and Send to GitHub Daily Use
git status
git diff
git add index.html
git commit -m "Update header navigation links"
git push
🌿 Scenario D: Working on a Feature Branch Professional
# Get latest main
git switch main && git pull origin main

# Create feature branch
git switch -c feature/user-login

# Work... then commit and push
git add .
git commit -m "Add user login form and validation"
git push origin feature/user-login

# On GitHub → create Pull Request → team reviews → merge
🔄 Scenario E: Pulling Latest from Team Repository Daily Use
git switch main
git pull origin main

# Update your feature branch too
git switch feature/my-feature
git merge main   # bring main's updates into your branch
🔘 Scenario F: Fixing a Mistake Using Git History Recovery
# Option 1: Undo last commit but keep files
git reset --soft HEAD~1

# Option 2: Safely revert a specific commit (recommended)
git log --oneline
git revert abc1234

# Option 3: Restore a single file to last commit
git restore index.html
💡

Always use git revert for undoing on shared/team branches. Safe, doesn't rewrite history.

☀️
Daily Workflow for a Developer

Build healthy Git habits — a simple daily routine that keeps you and your team happy

🌝 Morning — Start of Day

  1. Pull latest: git switch main && git pull origin main
  2. Create/switch to your branch: git switch -c feature/todays-task
  3. Check state: git status (should be clean)

💻 During Work

  1. Commit small & often: git add . && git commit -m "..."
  2. Check often: git status and git diff
  3. Urgent work? git stash → fix → git stash pop

🌆 End of Day

  1. Commit all finished work with a clear message
  2. Push branch to GitHub: git push origin feature/...
  3. Create a PR on GitHub if feature is complete
⭐

Golden Rules: Pull before you push. Commit often, commit small. Write meaningful messages. Never work directly on main. Push before end of day — it's your backup.

🏗️
Architect & Senior Developer Workflow

How experienced professionals use Git differently — strategy, oversight, and governance

👁️ Reviewing Pull Requests

git fetch origin
git switch feature/dev-login
# test it, then:
git switch main

📜 Understanding History

git log --oneline --graph --all
git log --author="Dev Name"
git blame src/auth/login.js

🚺 Release Management

git switch -c release/v2.1.0 develop
git switch main
git merge release/v2.1.0
git tag v2.1.0
git push origin main --tags

🛡️ Branch Strategy & Governance

  • Set branch protection rules (require PR reviews)
  • Enforce commit message conventions
  • GitHub Actions for CI/CD auto-testing on every PR
  • Monitor stale branches and open PRs

Branch Strategy Reference

BranchPurposeWho Merges
mainProduction-ready code onlyArchitect / Lead
developIntegration branch for ongoing workLead Developer
feature/*Individual feature workDevelopers via PR
release/*Preparing for releaseRelease Manager
hotfix/*Emergency production fixesArchitect
⚠️
Common Mistakes Beginners Make

Learn from others — avoid these 8 pitfalls before they bite you

❌ Committing Directly to Main

Making all changes on main instead of creating a feature branch. Fix: git switch -c feature/my-task — always, no matter how small the task.

❌ Forgetting to Pull Before Starting Work

Your code becomes outdated. Fix: Make git pull the very first command every morning, before writing a single line.

❌ Vague or Bad Commit Messages

# ❌ Bad  git commit -m "changes"
# ✓ Good  git commit -m "Fix mobile login button not responding on iOS 17"

❌ Committing Passwords or API Keys

Once pushed to a public repo, secrets are exposed forever — even if deleted later (they're still in history). Fix: Add .env to .gitignore before your first commit.

❌ Panicking During a Merge Conflict

Conflicts are normal. They're just Git asking which version of a line to keep. Open the file, pick the right version, remove the markers, commit. See Section 14.

❌ Forgetting .gitignore

# Example .gitignore
node_modules/
.env
dist/
*.log
.DS_Store

Use gitignore.io to generate one for your tech stack.

❌ Pushing Unfinished Work to Main

Always push to a feature branch. Only merge to main via Pull Request after testing and review.

❌ Confusing Git and GitHub

Git = tool on your machine. GitHub = website for hosting. You can commit locally without internet. Internet is only needed when pushing or pulling from GitHub.

🔀
Merge Conflicts — Explained Simply

They look scary. They're actually just Git asking you a question.

What Is a Merge Conflict?

A merge conflict happens when two different people edited the same line in the same file and Git can't decide which version to keep. Git is smart enough to merge most changes automatically. When it literally cannot decide, it stops and asks YOU.

What Does a Conflict Look Like?

<<<<<<< HEAD
<h1>Welcome to My Portfolio</h1>
=======
<h1>Hello, I'm a Developer!</h1>
>>>>>>> feature/new-hero-text
  • <<<<<<< HEAD → Your current branch's version
  • ======= → Divider between the two versions
  • >>>>>>> → The incoming branch's version

How to Resolve — Step by Step

  1. Don't panic. Open the conflicting file.
  2. Read both versions. Decide which is correct (or combine them).
  3. Delete the conflict markers and leave only the correct code.
  4. Save the file.
  5. git add index.html
    git commit -m "Resolve merge conflict in hero heading"

VS Code

Shows conflicts with "Accept Current", "Accept Incoming", "Accept Both" buttons — no manual marker removal needed.

GitHub Web Editor

Can resolve simple conflicts directly in the browser during a Pull Request.

💡

Best Prevention: Pull before you push, merge main into your branch regularly, and keep branches short-lived. The longer a branch lives, the more conflicts accumulate.

✅
Best Practices

Simple habits that make you a professional Git user from day one

✅ Commit Often, Commit Small

Small commits = easy history, easy bug-finding, easy to revert. Don't wait until you've written 500 lines.

✅ Write Meaningful Commit Messages

Format: verb + what + context. "Fix calculation bug in invoice total" beats "changes" every time.

✅ Always Use Branches

Main should always be deployable. Never work directly on it. One branch per feature or bug fix.

✅ Pull Before You Push

Always pull the latest before pushing yours. Prevents conflicts and protects others' work.

✅ Never Commit Secrets

Always put .env in .gitignore. Once a secret is in history, it's considered compromised.

✅ Write a README

Explain: what it does, how to set it up, how to run it. Future you will thank present you.

✅ Set Up .gitignore at Start

Before your first commit. Use gitignore.io to generate the right entries.

✅ Keep Branches Short-Lived

The longer a branch lives without merging, the more conflicts accumulate. Break large features into smaller PRs.

✅ Use git revert on Shared Branches

Never use git reset --hard on shared branches. Use git revert — safe, preserves history.

✅ Use Git History as a Superpower

git log, git diff, git blame. When something breaks, they help pinpoint exactly what changed.

❓
Beginner FAQ

Honest answers to the questions every beginner is afraid to ask

😧Is Git difficult to learn?▼

Git feels difficult at first because many commands are introduced all at once. But in daily work you use only 8–10 commands repeatedly. Once those become habit (usually 2–3 weeks), Git feels automatic. The hardest part is the first 3 days.

🌐Do I need GitHub to use Git?▼

No! Git works completely offline. You can create repos, commit, branch, and merge entirely locally. GitHub is only needed when you want to share code with others, back it up online, or collaborate as a team.

↩️Can I undo mistakes in Git?▼

Yes! This is one of Git's biggest strengths. Use git revert to safely undo commits. Use git reset to unstage files. Use git restore to discard working directory changes. The only hard-to-undo situation is git reset --hard after you've lost uncommitted work — which is why committing frequently matters.

💥What if I commit wrong code?▼

Not pushed yet: git reset --soft HEAD~1 undoes the commit but keeps your files. Already pushed: git revert [commit-id] creates a new commit that reverses the changes. Never use git push --force on a shared branch.

🗑️What if I accidentally deleted a file?▼

Deleted and not committed yet: git restore deleted-file.js brings it back instantly. Already committed the deletion: git revert [commit-id] will bring the file back. Git almost never truly loses your data if you've been committing regularly.

🌿Why are branches useful?▼

Branches let you work on new things without risking your stable code. Think of them as parallel universes. If an experiment works, you merge it. If it fails, delete the branch — nothing is lost. In teams, branches allow multiple developers to work simultaneously without interfering with each other.

😱I got a merge conflict — am I in trouble?▼

Not at all! Merge conflicts are completely normal. It's just Git saying "two people changed the same line — please tell me which version to keep." Open the file, pick the right version, delete the conflict markers, save, stage, and commit. See Section 14 for the full walkthrough.

🛡️What is the safest beginner workflow?▼

1. Pull from main every morning. 2. Create a new branch for each task. 3. Commit often with clear messages. 4. Push your branch at end of day. 5. Create a PR when done. 6. Never use --force. 7. Use git revert for undoing, not git reset --hard.

📅
7-Day Learning Plan

One week from zero to confident — a practical daily plan for beginners

💡

How to Follow This Plan: Spend 30–60 minutes each day. Actually type the commands — don't just read. Create a practice folder on your computer. By Day 7 you'll be doing real Git workflows confidently.

Day 1

🧠 Understand the Concepts

  • Read Sections 1–4 of this guide
  • Understand Git vs GitHub
  • Read Section 6 — all key terms
  • No commands yet — just read and understand
Day 2

⚙️ Setup Git

  • Install Git on your computer
  • Run git --version
  • Configure name and email
  • Create a GitHub account (free)
Day 3

📦 Init, Add, Commit

  • Create a practice folder
  • Run git init
  • Create 2–3 files
  • Practice git add and git commit
  • Make 5 commits today
Day 4

🌐 GitHub Push & Pull

  • Create a repo on GitHub
  • Connect with git remote add
  • Push your Day 3 commits
  • Edit a file on GitHub.com
  • Pull changes to your local machine
Day 5

🌿 Branching

  • Create a new branch feature/test
  • Make changes and commit on the branch
  • Switch back to main
  • Observe main is unchanged
  • Push the branch to GitHub
Day 6

🔀 Merge & Conflicts

  • Merge your feature branch into main
  • Intentionally create a conflict
  • Resolve it in VS Code
  • Commit the resolved conflict
Day 7

🎯 Real Project Workflow

  • Start a mini real project
  • Follow Section 11 — Daily Workflow
  • Create a PR on GitHub and merge it
  • Practice git stash
  • Review your full commit history
📌

After 7 Days: Weeks 2–3 — use Git for every project. Month 2 — interactive rebase, cherry-pick. Month 3 — CI/CD with GitHub Actions, branch protection, full PR workflows.

🎯
Final Revision — Quick Recap & Confidence Builder

Everything you need to remember, in one place. You're ready.

🏁 Quick Recap

  • Git = tool on your computer that tracks code changes over time (offline, local)
  • GitHub = website that hosts Git repos for team collaboration (online)
  • Commit = a saved snapshot of your changes with a message
  • Branch = a parallel version of your code for safe experimentation
  • Pull Request = proposal to merge your branch, reviewed by team on GitHub
  • Core Flow: Edit → git add → git commit → git push

⚡ If You Remember Only These 10 Commands...

git initStart tracking a folder
git clone <url>Download a project from GitHub
git statusSee what changed (use constantly)
git add .Stage all changes
git commit -m "msg"Save a snapshot with message
git pushUpload commits to GitHub
git pullDownload latest from GitHub
git switch -c <name>Create and move to new branch
git merge <branch>Merge branch into current
git log --onelineSee compact commit history

📋 Full Mini Cheat Sheet

CommandWhat It Does
git initInitialize new repo
git clone <url>Download repo from GitHub
git statusSee changed / staged / untracked files
git add .Stage all changes
git commit -m "msg"Commit with message
git log --onelineView compact history
git diffSee exact line changes
git pushUpload to GitHub
git pullDownload from GitHub
git branchList branches
git switch -c <name>Create + switch to new branch
git switch <name>Switch to existing branch
git merge <branch>Merge branch into current
git stashTemporarily save work
git stash popRestore stashed work
git revert <id>Safely undo a commit
git remote -vShow remote connections
git remote add origin <url>Connect to GitHub remote

🏋️ Practice Exercise — Do This Right Now

# 1. Create a practice project
mkdir git-practice && cd git-practice && git init

# 2. Create and commit 3 files
echo "Hello World" > hello.txt
git add hello.txt && git commit -m "Add hello.txt"

echo "Notes here" > notes.txt
git add notes.txt && git commit -m "Add notes.txt"

echo "# My Practice Project" > README.md
git add README.md && git commit -m "Add README"

# 3. Create a branch and add a file
git switch -c feature/add-about
echo "About me: I'm learning Git!" > about.txt
git add about.txt && git commit -m "Add about page content"

# 4. Merge back to main
git switch main && git merge feature/add-about

# 5. View your history
git log --oneline

# 🎉 Congratulations — you just completed a real Git workflow!

📚 Recommended Next Steps

🌟

Final Words: Git becomes natural with repetition. Every professional developer felt confused at first. Start using Git today for every project, no matter how small. Within a month it will feel like breathing. You've got this! 💪