Git & GitHub Assignments — Commit. Collaborate. Master.

Build real confidence with version control and team workflows. Each topic-wise set includes 20 Basic, 20 Intermediate, and 10 Advanced questions to take you from solo commits to production-grade collaboration.

Why practice with these assignments?

  • Move beyond theory—create repos, branch, merge, rebase, and resolve conflicts.
  • Learn safe history edits, release tagging, patching, and recovery.
  • Master GitHub collaboration: Issues, Pull Requests, Reviews, Actions, and Releases.
  • Prepare for interviews and real teams with tasks that mirror day-to-day workflows.

How it works

  1. Pick a topic from the list.
  2. Attempt questions in order: Basic → Intermediate → Advanced.
  3. Practice locally; push to GitHub for remote collaboration tasks.
  4. Inspect results with status, log, diff, and GitHub PR checks.
  5. Save your best solutions as portfolio-ready examples.

Notes:

  • Focus is Git 2.x and GitHub.
  • You can complete many tasks locally; GitHub tasks need a free account.
  • Use private test repos when experimenting with history rewrites.

What you’ll achieve

  • Solid mental model of working tree → index (staging) → commits → branches → remotes.
  • Confidence with branching strategies, conflict resolution, and clean history.
  • Fluency with Pull Requests, reviews, CI pipelines, and protected branches.
  • Safety skills: recover work with reflog, restore/reset, and cherry-pick.

Who should use this page?

Beginners learning version control, students preparing for interviews, and teams standardizing on professional GitHub workflows.

Tips for success

  • Commit small, focused changes with clear messages (Conventional Commits help).
  • Prefer branches + PRs over direct pushes to main; enable protection rules.
  • Rebase your feature branch before opening a PR; avoid rewriting shared history.
  • Use interactive rebase to clean up commits before merge (squash/fixup).
  • Learn reflog—it’s your safety net for recovering work.
  • Keep .gitignore/.gitattributes close to the codebase; fix line endings early.
  • Add CI (GitHub Actions) to run tests/linters on every PR.

Ready to build real confidence in Git and GitHub? Pick a set below and start solving!

FAQs

Q1. Do I need GitHub to finish these?

Many tasks are local-only. Collaboration, PR, and CI tasks require a (free) GitHub account.

Q2. How do I verify correctness?

Use status, log –graph –oneline –decorate, diff, and PR checks. Ensure CI turns green and branch protection rules pass.

Q3. Is it safe to rewrite history?

Rewrite only on private or unshared branches. Never rewrite history on branches others have pulled.

Q4. Are there solutions?

Selected topics include reference flows and example commands—review only after attempting.

Q5. How much time should I spend?

Plan 10–40 minutes per difficulty band per topic; CI and monorepo tasks may take longer.