Key insight: GitHub Flow is the most common workflow—simple enough for small teams, scales to large ones.
Figma + Git
Design tokens, not design files
Principles Identified:
Tokens in GitExport design tokens as JSON/CSS
Figma for DesignKeep visual files in Figma
Single SourceTokens sync between design and code
Key insight: Design systems export tokens (colors, spacing) to Git while keeping visual design in Figma.
Fork → PR → Discuss
Contribute to any project
Principles Identified:
ForkCopy project to your account
ContributeMake changes, submit PR
CollaborateMaintainers review and merge
Key insight: Git enables global collaboration—anyone can contribute improvements to public projects.
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
Rule: Never push directly to main. Create a branch, open a PR, get review, then merge.
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"
Rule: Commit messages should explain what changed and why. Future you will thank you.
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
Rule: Small PRs get better reviews. Break large features into multiple smaller PRs.
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
Rule: Always pull the latest main before creating a new branch. Reduces conflicts.
Quick Check
Before pushing: Is my commit message clear? Is my PR focused? Have I pulled latest main?
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 ✓
Tools
GitHub/GitLab for hosting, VS Code Git integration, GitKraken/Tower for GUI.
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
Tip: Always start from fresh main to minimize merge conflicts.
# 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
Tip: Commit often. Small, focused commits are easier to understand and revert.
# 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
Tip: Use -u on first push so future pushes just need 'git push'.
# 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
Tip: Pull main and merge/rebase regularly. Don't let your branch get too stale.
Test your understanding of version control concepts.
Q1
What is the purpose of a commit?
Click to reveal
Answer: A commit is a snapshot of your project at a point in time. It records what changed, who made the change, when, and why (via the commit message). Commits create a permanent history you can browse and revert to.
Q2
Why should you use branches instead of working directly on main?
Click to reveal
Answer: Branches let you work on features/fixes in isolation without affecting the stable main branch. Multiple people can work in parallel without conflicts. Changes go through review before merging. Main stays deployable.
Q3
What makes a good commit message?
Click to reveal
Answer: Good commit messages: explain what changed and why, use imperative mood ('Add feature' not 'Added feature'), keep first line under 50 characters, include ticket/issue numbers when relevant. Future readers should understand the change.
Q4
What is a pull request and why is it important?
Click to reveal
Answer: A pull request is a proposal to merge your branch into main. It enables code review—teammates can see changes, comment on specific lines, request changes, and approve. PRs ensure quality and shared understanding of changes.
Q5
How do you handle merge conflicts?
Click to reveal
Answer: Conflicts occur when two branches change the same lines. Git marks the conflict in the file. You manually choose which version to keep (or combine them). Minimize conflicts by: pulling main often, keeping PRs small, communicating with team.