Guide-linked quiz · Easy Level

How to Write Git Commit Messages with AI Quiz

Check how to ground AI commit-message drafts in staged changes, communicate intent, report tests accurately, and verify repository conventions.

Question 1 of 8

A developer wants AI to summarize only the files prepared for a commit. What should they inspect or provide?

Preview every question8 questions

Answers and explanations appear as you take the quiz.

  1. A developer wants AI to summarize only the files prepared for a commit. What should they inspect or provide?
    • The entire repository without identifying staged changes
    • The staged diff showing changes prepared for the next commit
    • Only the current branch name
    • A screenshot of the code editor
  2. The diff shows a compatibility workaround, but not why it is needed. What should the commit body include?
    • Verified rationale supplied by the author
    • A guessed explanation from the model
    • A claim that all users requested it
    • Nothing except a second subject line
  3. Why should a generated message avoid claiming tests passed when only test files changed?
    • Test files can never be committed
    • Git commits automatically run every test
    • A message should always describe a successful test
    • The diff does not prove the tests were executed successfully
  4. Which format is described in Git’s commit documentation as a useful pattern?
    • A single paragraph with no title
    • A required JSON object in every repository
    • A short title, blank line, then a fuller description
    • A filename list without a summary
  5. A repository requires Conventional Commits. The AI suggests a feature type for a documentation-only correction. What should the author do?
    • Use the suggestion because AI knows the convention
    • Check the repository rule and correct the type to match the actual change
    • Remove the staged docs
    • Add a feature type to every commit
  6. The working tree contains an unrelated local edit. Why check the staged diff before drafting?
    • The message should describe the change that will actually be committed
    • Git includes every working-tree change in every commit automatically
    • The AI can decide which unrelated edits are safe to include
    • A commit message stages files by itself
  7. Who is responsible for the accuracy of an AI-drafted commit message?
    • The language model after the message is displayed
    • The Git server alone
    • The next person who reads the history
    • The author who reviews and records it
  8. A patch changes code and includes tests, but the team has not run them. What is a truthful message choice?
    • Say all tests passed to make the message complete
    • Claim the patch is risk-free
    • Describe the change and omit or accurately qualify any test claim
    • Use the test filenames as proof of success

Keep testing yourself

More quizzes picked for your level.

View all quizzes