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
📚 Git Topics to Study (23)
✍️ Sample Git Questions & Answers
1. How do you set a credential helper to cache your credentials for 1 hour?
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`?
The `--graph` option draws an ASCII representation of the commit graph alongside the log output.
3. What does `git commit --amend` do?
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`?
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?
`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`?
The `git branch -m old-name new-name` command renames the specified local branch.