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. How do you keep a forked repository up to date with the original project?

    Add the original repo as a second remote called upstream, fetch it, merge or rebase upstream/main into your main, and push to your fork. GitHub also has a Sync fork button for the same job.

    IntermediateQuick answer1 min read