Skip to content
codinganthem

Git skill check

Test your Git: staging, branching, merge versus rebase, remotes, undoing changes safely, and team workflows.

15

Questions

11 min

Timer can't pause

Multiple choice

Git 2.4x

Choose a level

Topics

  • Basics and staging
  • Branching
  • Merging
  • Rebasing
  • Remotes
  • Undoing changes
  • History
  • Workflows

Do

Use scratch paper or a notepad to work things out. Skip a question and come back to it later.

Don't

Look up answers during the check. Open the check in more than one tab or window.

Easy · 15 questions · 11 min

By starting, you agree to the Terms and Privacy Policy.

Start practice

Practice checks each answer as you go, with an explanation. The exam is checked when you submit; 9 of 15 passes and earns a certificate.

Checking your levels…

Certificates come from the certified exam: pass with 9 of 15 while signed in. View a sample certificate.

Sample Git questions with answers

These are never used in a check, so seeing their answers here won't give anything away.

  1. Question 1 · Easy · Branching

    Which command creates a new branch named feature-login and immediately switches the working tree to it?
    1. A.git branch --create feature-login
    2. B.git switch -c feature-login
    3. C.git branch -m feature-login
    4. D.git checkout -b feature-login --detach
    Show answer

    B. git switch -c feature-login

    In modern Git, git switch -c <name> (or git checkout -b <name>) creates a new branch and switches HEAD to it. git switch is specifically designed for switching branches.
  2. Question 2 · Easy · Merging

    When does Git perform a fast-forward merge instead of creating a 3-way merge commit?
    1. A.Only when the merge is initiated with the --no-ff flag
    2. B.When both branches share the exact same number of commits
    3. C.When the target branch has no new commits since the source branch diverged
    4. D.Whenever there are no conflicting line changes between both branches
    Show answer

    C. When the target branch has no new commits since the source branch diverged

    A fast-forward merge occurs when the current branch head is an ancestor of the branch being merged in. Git can simply move the branch pointer forward without generating a new merge commit.
  3. Question 3 · Moderate · Basics and staging

    You modify an existing file app.py, run 'git add app.py', and then make an additional edit to app.py without running any other command. What will 'git commit -m "Update app"' record?
    1. A.An error stating that unstaged changes conflict with staged changes
    2. B.Both the first and second modifications to app.py
    3. C.Only the state of app.py as it was when 'git add' was executed
    4. D.Neither modification, because the index detected that the working tree changed after staging
    Show answer

    C. Only the state of app.py as it was when 'git add' was executed

    'git add' snapshots file content into the index (staging area). Subsequent changes in the working directory remain unstaged unless 'git add' is run again or '-a' is passed to 'git commit'.
  4. Question 4 · Advanced · Rebasing

    Consider a rebase operation running git rebase --onto C B A. What commit range is selected to be replayed onto commit C?
    1. A.Commits reachable from B and A up to their merge base
    2. B.Commits reachable from A but not from B (B..A)
    3. C.Commits reachable from B but not from C (C..B)
    4. D.Commits reachable from A but not from C (C..A)
    Show answer

    B. Commits reachable from A but not from B (B..A)

    In git rebase --onto <newbase> <upstream> <branch>, Git checks out <branch> (here A) and replays commits in <upstream>..<branch> (here B..A) onto <newbase> (C).

How scoring and certificates work

  • Each check has 15 multiple-choice questions with one correct answer, and one timer for the whole check. A question you leave unanswered scores nothing.
  • Practice is free without an account and shows whether each answer is right as you go, with an explanation.
  • The certified exam is scored when you submit. 60% passes, which is 9 of 15. Easy unlocks Moderate, and Moderate unlocks Advanced.
  • Passing the exam while signed in earns a free certificate, valid for one year, with its own verification page. See a sample certificate.

Free tools for Git: Text Compare