03 / 09

What is the difference between Git and GitHub?

Git is a version control system (tool). GitHub is a cloud-based hosting service for Git repositories (a platform for collaboration).

Difficulty: 5/10
Topics: Version control, Remote hosting, Collaboration

Scenario Questions

0-2 years experience
  1. 1

    If you clone a repository from GitHub to your laptop, which tool actually performs the version‑control operations, and what role does GitHub play in that workflow?

  2. 2

    Walk me through creating a new branch, committing a change, and pushing it so teammates can see it. Where does Git end and GitHub begin?

  3. 3

    What happens if you try to push a commit to a GitHub repo but haven’t configured a remote URL yet?

2-5 years experience
  1. 1

    Your team is choosing between an internal Git server and GitHub Enterprise for a private codebase. What factors would you compare, and how do Git and GitHub differ in capabilities and trade‑offs?

  2. 2

    During a release a teammate’s push is rejected with a non‑fast‑forward error. Explain why this occurs and how GitHub’s UI can help resolve it.

  3. 3

    We need a CI pipeline that triggers on pull‑request events. Why does the pipeline interact with GitHub rather than just Git, and what responsibilities belong to each?

5-8 years experience
  1. 1

    Our monorepo is now 2 TB and clone times from GitHub are slow. Discuss strategies at both the Git level and the GitHub hosting level to mitigate this, including partial clones, shallow clones, and Git LFS.

  2. 2

    We want to enforce branch‑protection and code‑review policies across dozens of repos. How would you use GitHub features versus pure Git hooks to achieve this at scale?

  3. 3

    When migrating a legacy SVN repository to Git and hosting it on GitHub, what challenges arise from the differences between Git and GitHub, and how would you handle history rewriting and access control?

8+ years experience
  1. 1

    Our organization is consolidating multiple GitHub Enterprise instances into a single centralized instance for better governance. Outline the architectural considerations, migration steps, and how you’d manage the distinction between Git data and GitHub metadata.

  2. 2

    Design a cross‑team workflow that uses Git for source control but also leverages GitHub’s API for automated compliance checks, audit logging, and release management. What are the key boundaries and failure modes?

  3. 3

    We need to support both GitHub and an internal Git server for external partners while keeping a single source of truth. How would you architect synchronization, handle divergent features like pull‑request metadata, and ensure consistency?

Follow-up Questions

  • Can you describe a case where using only Git without GitHub would be insufficient?
  • What steps would you take if you needed to rewrite history after the repo is already on GitHub?
  • How do security and access‑control considerations differ between a self‑hosted Git server and GitHub?