← Back to Course

Module 25

Version Control

Part B

Print vs Web

09

undefined

undefined

Part C

Science & Psychology

10

undefined

undefined

undefined
Cognitive Benefits

undefined

undefined
Psychological Safety

undefined

undefined
Team Communication

undefined

Part D

Real-World Examples

11

Version Control in Practice

How teams use version control effectively.

Branch → PR → Review → Merge

Simple, effective workflow

Principles Identified:
Simplicity One main branch, feature branches
Code Review Every change reviewed via PR
Continuous Deploy Main is always deployable

Figma + Git

Design tokens, not design files

Principles Identified:
Tokens in Git Export design tokens as JSON/CSS
Figma for Design Keep visual files in Figma
Single Source Tokens sync between design and code

Fork → PR → Discuss

Contribute to any project

Principles Identified:
Fork Copy project to your account
Contribute Make changes, submit PR
Collaborate Maintainers review and merge

Part E

Common Failures

12

Version Control Mistakes

Common errors that cause team friction.

Failure: Committing to Main Directly

Direct push to main

No review, potential bugs

Fix: Always use feature branches

Branch → PR → Review → Merge

Changes reviewed first

Failure: Vague Commit Messages

"updates"
"fixed stuff"
"WIP"
"changes"

Fix: Write descriptive messages

"Fix nav overflow on mobile"
"Add dark mode toggle"
"Refactor button styles"

Failure: Massive Pull Requests

+2,847 lines, 45 files

Impossible to review

Fix: Keep PRs small and focused

+150 lines, 5 files

Easy to understand

Failure: Not Pulling Before Starting

Branch from stale main

Merge conflicts later

Fix: Always pull latest main first

git pull → git checkout -b

Start from latest

Part F

Visual Tests

13

Version Control Best Practices

Checklist for healthy Git workflows.

01

Commit Message Audit

Tests: Message quality

Review your last 10 commits. Are messages descriptive? Could you understand what changed 6 months from now? Aim for 'what + why' in each message.

git log --oneline -10

Review recent history

02

PR Size Check

Tests: Reviewability

Is your PR under 400 lines? Can it be reviewed in 15 minutes? If not, consider splitting into smaller PRs. Large PRs get rubber-stamped, not truly reviewed.

< 400 lines ✓

< 10 files ✓

Single purpose ✓

03

Branch Hygiene

Tests: Repository cleanliness

Are merged branches deleted? Are branch names descriptive? Is main always deployable? Regular cleanup keeps the repo manageable.

☑ Delete merged branches

☑ Descriptive names

☑ Main is deployable

04

Review Participation

Tests: Team engagement

Is everyone participating in reviews? Are reviews timely (< 24 hours)? Is feedback constructive and specific? Good reviews improve everyone's work.

Response time: < 24h ✓

Specific feedback ✓

Team participation ✓

Part G

CSS Implementation

14

Git Commands Reference

Essential Git commands for daily work.

# Get latest changes
git pull origin main

# Create new branch
git checkout -b feature/my-feature

# Or, shorter version
git checkout -b feature/my-feature origin/main
Starting Work via CSS
  • git pull - Download latest changes
  • git checkout -b - Create and switch to branch
  • origin/main - Base branch on remote main
# See what's changed
git status

# Stage specific files
git add path/to/file.css

# Stage all changes
git add .

# Commit with message
git commit -m "Add dark mode styles"

# Commit with longer message
git commit
Making Commits via CSS
  • git status - See uncommitted changes
  • git add - Stage files for commit
  • git commit -m - Commit with inline message
# Push branch to remote
git push origin feature/my-feature

# Push and set upstream
git push -u origin feature/my-feature

# Then open PR in GitHub/GitLab web interface
# Or use GitHub CLI:
gh pr create --title "Add feature" --body "Description"
Pushing & PRs via CSS
  • git push origin - Upload branch to remote
  • -u flag - Set upstream for future pushes
  • gh pr create - GitHub CLI for PRs
# Switch to main
git checkout main

# Get latest
git pull

# Go back to feature branch
git checkout feature/my-feature

# Merge main into your branch
git merge main

# Or rebase (cleaner history)
git rebase main
Staying Updated via CSS
  • git merge main - Bring main changes into branch
  • git rebase main - Replay commits on top of main
  • Regular updates - Minimize merge conflicts

Part H

Self-Assessment

15

Self-Assessment

Test your understanding of version control concepts.

Q1

What is the purpose of a commit?

Click to reveal
Q2

Why should you use branches instead of working directly on main?

Click to reveal
Q3

What makes a good commit message?

Click to reveal
Q4

What is a pull request and why is it important?

Click to reveal
Q5

How do you handle merge conflicts?

Click to reveal

Key Takeaways

Commits Are Snapshots undefined

undefined

Branch for Everything undefined

undefined

Small, Focused PRs undefined

undefined

Review Is Collaboration undefined

undefined

Pull Often, Conflict Less undefined

undefined