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 a fork, a clone and a branch?

    A fork is your own server-side copy of someone else's GitHub repository. A clone is a local copy on your computer. A branch is a separate line of work inside one repository.

    BeginnerQuick answer1 min read
  2. What is the difference between git init and git clone?

    git init turns the current folder into a new, empty repository. git clone copies an existing repository, including its full history, from a URL, and also sets up the origin remote for you.

    BeginnerQuick answer1 min read
  3. Why is the submodule folder empty after cloning, and how do you fix it?

    A normal clone does not download submodule contents. Run git submodule update --init --recursive, or clone with git clone --recurse-submodules next time.

    BeginnerQuick answer1 min read