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.
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.
Question 1 · Easy · Branching
Which command creates a new branch namedfeature-loginand immediately switches the working tree to it?- A.
git branch --create feature-login - B.git switch -c feature-login
- C.git branch -m feature-login
- D.
git checkout -b feature-login --detach
Show answer
B. git switch -c feature-login
In modern Git,git switch -c <name>(orgit checkout -b <name>) creates a new branch and switches HEAD to it.git switchis specifically designed for switching branches.- A.
Question 2 · Easy · Merging
When does Git perform a fast-forward merge instead of creating a 3-way merge commit?- A.Only when the merge is initiated with the
--no-ffflag - B.When both branches share the exact same number of commits
- C.When the target branch has no new commits since the source branch diverged
- 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.- A.Only when the merge is initiated with the
Question 3 · Moderate · Basics and staging
You modify an existing fileapp.py, run 'git add app.py', and then make an additional edit toapp.pywithout running any other command. What will 'git commit -m "Update app"' record?- A.An error stating that unstaged changes conflict with staged changes
- B.Both the first and second modifications to
app.py - C.Only the state of
app.pyas it was when 'git add' was executed - D.Neither modification, because the index detected that the working tree changed after staging
Show answer
C. Only the state of
app.pyas 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'.Question 4 · Advanced · Rebasing
Consider a rebase operation runninggit rebase --onto C B A. What commit range is selected to be replayed onto commitC?- A.Commits reachable from B and A up to their merge base
- B.Commits reachable from A but not from B (
B..A) - C.Commits reachable from B but not from C (
C..B) - D.Commits reachable from A but not from C (
C..A)
Show answer
B. Commits reachable from A but not from B (
B..A)Ingit rebase --onto <newbase> <upstream> <branch>, Git checks out<branch>(hereA) and replays commits in<upstream>..<branch>(hereB..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