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. How do you work from an old tag, and can you move or delete a tag?

    Checking out a tag puts you in detached HEAD, so create a branch from it with git switch -c fix v1.0. You can delete a tag with git tag -d, but moving a published tag confuses others and should be avoided.

    IntermediateQuick answer1 min read
  2. What is a detached HEAD, and how do you get out of it?

    Detached HEAD means HEAD points directly at a commit instead of a branch, for example after checking out a tag or an old hash. New commits there belong to no branch and can be lost unless you create a branch.

    IntermediateQuick answer1 min read