Git Study Guide 2026

Everything you need to pass the Git exam in one place: the exam format, every topic to study, real practice questions with explanations, flashcards, and full-length practice tests. Free, no sign-up needed.

📋 Git Exam Format at a Glance

88
Questions
120 min
Time Limit
70.00%
Passing Score

📚 Git Topics to Study (23)

✍️ Sample Git Questions & Answers

1. How do you set a credential helper to cache your credentials for 1 hour?
git config --global credential.helper 'cache --timeout=3600'

The `credential.helper cache --timeout=3600` setting stores credentials in memory for 3600 seconds (one hour) before they expire.

2. Which option shows a visual ASCII graph of branch and merge history in `git log`?
--graph

The `--graph` option draws an ASCII representation of the commit graph alongside the log output.

3. What does `git commit --amend` do?
Modifies the most recent commit by adding staged changes or editing its message

The `--amend` flag replaces the most recent commit with a new one that includes any newly staged changes and an optionally updated message.

4. What does `git push --force-with-lease` do differently from `git push --force`?
It only force-pushes if the remote branch has not been updated by someone else since your last fetch

The `--force-with-lease` flag verifies that no one else has pushed new commits since your last fetch before overwriting the remote branch.

5. When reverting a merge commit, which flag specifies which parent to treat as the mainline?
-m

`git revert -m 1 ` uses `-m` to specify the parent number; `1` typically refers to the branch you merged into (the mainline).

6. Which command renames a local branch from `old-name` to `new-name`?
git branch -m old-name new-name

The `git branch -m old-name new-name` command renames the specified local branch.

🎯 Free Git Practice Tests

📖 Git Guides & Articles

Your Git Study Path
1. Learn with Flashcards → 2. Drill Practice Tests → 3. Take the Full Exam Simulation
Git Study Guide 2026 — Exam Format, Topics & Practice Questions