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 push --force and --force-with-lease?

    --force overwrites the remote branch no matter what. --force-with-lease overwrites only if the remote is still where you last saw it, so you do not wipe out commits a teammate pushed meanwhile.

    IntermediateQuick answer1 min read