🔰 1. What is Git?
Git = Version Control System
👉 It helps you:
- Track changes in your code
- Go back to previous versions
- Collaborate with others safely
Think of it like:
“Google Docs version history… but for code”
Git records every change as a snapshot (commit) ([FreeCodeCamp][1])
🌐 2. What is GitHub?
- GitHub is a cloud platform that hosts Git repositories
-
It allows:
- Collaboration
- Sharing code
- Team development
👉 Key idea:
- Git = tool
- GitHub = online platform using Git ([product.hubspot.com][2])
🏗️ 3. Core Git Concepts (VERY IMPORTANT)
📁 Repository (Repo)
A project folder tracked by Git
🧾 Commit
A saved snapshot of your work
📦 Staging Area
Where you prepare changes before saving
🌿 Branch
A separate version of your project (for new features)
🔀 Merge
Combining branches together
⚙️ 4. Basic Git Workflow (The Heart of Everything)
This is the main flow taught in the video:
Step 1: Initialize Git
git init
👉 Turns your folder into a Git repository
Step 2: Add Files
git add .
👉 Moves files to the staging area
Step 3: Commit Changes
git commit -m "Your message"
👉 Saves a snapshot of your work
Step 4: Connect to GitHub
git remote add origin <repo-url>
Step 5: Push to GitHub
git push -u origin main
👉 Uploads your code online
🔄 5. Everyday Git Commands
Check status
git status
See history
git log
Download updates
git pull
Upload changes
git push
🌿 6. Working with Branches (Key Skill)
Create a branch
git checkout -b feature-name
Switch branch
git checkout main
Merge branch
git merge feature-name
👉 Why branches matter:
- Work on features without breaking main code ([product.hubspot.com][2])
🤝 7. Collaboration Workflow (GitHub Flow)
This is how teams work:
- Create branch
- Make changes
- Push branch
- Open Pull Request (PR)
- Review
- Merge
👉 Pull Request = “Please review my changes”
🧠 8. Mental Model (Very Important)
Think of Git like this:
Working Directory → Staging → Commit → GitHub
- Working → you edit files
- Staging → you prepare changes
- Commit → you save version
- GitHub → you share it
⚡ 9. Common Beginner Mistakes (From the Video)
- ❌ Forgetting to
git add - ❌ Bad commit messages
- ❌ Working directly on main branch
- ❌ Not pulling before pushing
🚀 10. Your First Practice Exercise
Try this:
mkdir my-project
cd my-project
git init
echo "Hello Git" > file.txt
git add .
git commit -m "First commit"
# connect to GitHub repo
git remote add origin <your-repo-url>
git push -u origin main
Top comments (0)