Interview Q&A / Git & GitHub

INTERVIEW Q&A · 97 QUESTIONS

Git & GitHub interview questions

Branching, merge vs rebase, resolving conflicts and pull requests, the way teams actually work.

  1. What is the difference between Git and GitHub?

    Git is a version control tool that runs on your own computer and records the history of your code. GitHub is a website that hosts Git repositories online and adds collaboration features like pull requests, code review, issues and CI. You can use Git without GitHub, but GitHub is built on top of Git.

    BeginnerIn-depth3 min read
  2. What does git status tell you, and how do you read its output?

    git status reports your current branch, how it compares with its upstream, and three groups of files: staged changes ready to commit, modified but unstaged changes, and untracked files Git does not know yet.

    BeginnerQuick answer1 min read
  3. What is HEAD in Git?

    HEAD is a pointer to the commit you currently have checked out. Normally it points to a branch name, which points to that branch's latest commit, so HEAD marks where your next commit will be added.

    BeginnerQuick answer1 min read
  4. What is the staging area in Git, and why does it exist?

    The staging area (index) is a holding zone between your working files and the next commit. git add puts chosen changes there, so a commit contains exactly what you picked rather than everything you touched.

    BeginnerQuick answer1 min read