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 makes a good Git commit message?

    A short imperative summary line of about 50 characters, a blank line, then an optional body explaining why the change was made. Describe the reason, not just what the diff already shows.

    BeginnerQuick answer1 min read
  2. Why are commit messages written in the imperative mood?

    Git's own messages, like 'Merge branch' or 'Revert commit', are imperative, and the convention completes the sentence 'If applied, this commit will...'. It keeps the log consistent and short.

    BeginnerQuick answer1 min read